Contact form not working...

  1. sofielyr

    Hi, I would really appreciate if someone could have a look at the following code to see if it is correct. My contact form doesn't seem to work as the emails don't get forwarded to my email address (adim email in wordpress).
    I have a feeling that it has something to do with an update in wordpress. Please help!

    		require("../../../../wp-load.php"); //required to include wordpress file
    		GLOBAL $shortname;
    		$mailTo = get_option($shortname.'_contact_admin_email');
    		$name = $_POST['name'];
    		$mailFrom = $_POST['email'];
    		$subject = $_POST['subject'];
    		$message = $_POST['message'];
    		$headers = "From: $mailFrom";
    		$subject = $subject." - A message from ".get_option('siteurl');
    		$body = "Name: $name\n\n"
    			. "Email: $mailFrom\n\n"
    			. "Subject: $subject\n\n"
    			. "Message: \n$message"
    		$Send_Email = (mail($mailTo, $subject, $body, $headers));
    Posted: 7 years ago #
  2. mrmist

    Please use the forums for questions like this.


    Posted: 7 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    0 Votes
  • Status

    This is not a core suggestion