-1

I am developing a website in wordpress for my company, however and with all implemented, i found that the contact page form isn't working.

The solutions i've searched, made me install wp smtp, or smtp tools that would make me configure the manual settings of the smtp, what i did, and the test message went well, however in the end when i tried again to send with the contact page form it gave me a email server error. I changed the contact page php file, I've tried to search other solutions but nobody from the developing answer me , and I am quite in a hurry, and solutions are atm 0. http://fusioncowork.com/contactos/

Thanks in advance

  • 1
    What did you change in the contact page php file? – Steve Dec 15 '15 at 19:18
  • In case it is not clear `your_domain.com` should be `fusioncowork.com` in your contact form. – Steve Dec 15 '15 at 19:22
  • The same basic thinking applies - is your "From:" address on your server? – Steve Dec 16 '15 at 20:13
  • Does a really basic script work like `$email = 'you@hotmail.com'; $to = 'you@hotmail.com'; $your_email = 'your_email@your_server.com'; $subject = "Hello"; $message = "Hello"; $headers = "From: $your_email" . "\r\n"; // Additional headers $headers .= "Reply-To: $email" . "\r\n"; if(mail($to,$subject,$message,$headers)){ echo "Success"; } else { echo "not sent"; }` – Steve Dec 18 '15 at 22:38

2 Answers2

0

Go to your your domainname.com/wp-options.php (after you logged in)

You'll see all settings of wordpress. Search for emails and look at the settings. Change the default or empty settings to the correct settings (like smtp).

If you changed it and it didn't work, try a 3rd party smtp plugin (again) to test if that caused the error.

Did you try more than one smtp plugin?

  • My bad, go to your domain.com/wp-options.php – Michael Vermeulen Dec 15 '15 at 12:40
  • Edited the answer @rnevius – Michael Vermeulen Dec 15 '15 at 12:47
  • Sorry Pedro, I've made a mistake in typing my answer. You should go to your domain.com/wp-options.php after you logged in. It will take you to a hidden page where you can see every settinf wordpress has including email options. – Michael Vermeulen Dec 15 '15 at 12:50
  • and it was already edited, i found the smtp fields and it isn't working as well , it appears all the right configs – Pedro Santos Dec 15 '15 at 12:50
  • Hmmm... Are you using contact form7? Make sure you're sending the emails to the right email account. Also, if you tried these solutions, contact your hosting provider. Might be something with the server. Good luck! – Michael Vermeulen Dec 15 '15 at 12:53
  • but my issue is that the testing email is sent , isn't this strange?? why jsut with the theme form? – Pedro Santos Dec 15 '15 at 12:54
  • Test Message Sent The result was: bool(true) The full debugging output is shown below: – Pedro Santos Dec 15 '15 at 12:55
  • My bad, sounds like a theme issue then. Contact the developer or search through the theme files. – Michael Vermeulen Dec 15 '15 at 12:56
  • If your `"From:"` address is not a valid email address on your server mail will likely fail - perhaps the demo is set up that way. You can't really use `"From:" . $email` (the submitted address - use that as the `"Reply-To:"`). A few notes that might help: http://stackoverflow.com/questions/33948622/php-mail-function-server-and-localhost-not-working/33948920#33948920 Also `ini_set(sendmail_from ini_set('sendmail_from', 'your_email@your_server.com');` got my ContactForm7 working. – Steve Dec 15 '15 at 18:08
0

The FROM must be

[your-name] <wordpress@your_domain.com> 

and it must exist as a valid email address on your server (usually set up by installation).

"From:" is best left as only wordpress@your_domain.com for starters - ALL mail must come FROM this address - You need to add a "reply-to" with the guest's details in that, so that when it arrives it will have an email address that you can answer to. This will satisfy email blocking.

The "reply-to" can be the email address they fill in rather than your email - i.e. you enter their email in the form and the contact form picks that up for reply-to, that would be: [guest-email]

Reply-To: [visitor-name] <[visitor-email]>

and in the top of the script on the contact form page you can add:

<?php ini_set(sendmail_from ini_set('sendmail_from', 'wordpress@your_server.com'); ?>

Might be handy references - my personal preference is PHPMailer. http://www.codingmonkey.ca/contact-form-emails-wont-send-with-my-visitors-email-address/

http://contactform7.com/best-practice-to-set-up-mail/

Steve
  • 808
  • 1
  • 9
  • 14