Support » Fixing WordPress » Contact form not working…

  • 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!

    <?php
    		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));
    ?>

  • The topic ‘Contact form not working…’ is closed to new replies.