3

The contact 7 form in one of wordpress website is configured to send email to an account created in outlook.com

The form on submission shows success message but the message is never received in my outlook account.

Setting the recipient email to any gmail account works fine as email is received successfully.

Please suggest any possible solution for this.

1 Answers1

2

I had the exact same problem, and emails never even reached the junk folder, they just never arrived. Here is what I did:

In outlook.com:

In your account -> click the settings gear -> More mail settings -> Safe and blocked senders -> safe senders.

Add your domain: example.com

For hostname it wont be white listed automatically so add it as well: yourhost.example.com

PHP:

Make sure your $senderEmail (that is attached to the $headers) is within the safe sender you have added.

$headers = "From: " . $senderName . " <" . $senderEmail . ">";
$success = mail( $recipient, EMAIL_SUBJECT, $message, $headers );

This made it go straight to inbox.

Hope this helps.

EDIT:

It may also be far easier and productive to use a 3rd party service such as SendGrid or MailGun since directly meddling with email and servers configurations could be a major time sink.

realtimez
  • 2,525
  • 2
  • 20
  • 24
  • Thanks for the answer. I did the same as mentioned but I am still not receiving any emails. – Farhat Rasheed Dec 20 '13 at 08:26
  • Not sure which OS you are using but the problem may be in your hosts file. Make sure it is properly formatted. See this link: https://github.com/DigitalOcean-User-Projects/Articles-and-Tutorials/blob/master/set_hostname_fqdn_on_ubuntu_centos.md – realtimez Dec 22 '13 at 01:59