0

I am using the PHP mail() function to send e-mail. I am able to receive mail sent from my web app at an e-mail from the same domain (e.g. if my web app is on mywebsite.com, I can only receive emails from the app from the address me@mywebsite.com). I have tried to send mail to two Gmail addresses and an Outlook address and it is not getting received.

Here's my mail function:

mail($email, "Subject", $message, "From: somebody@mywebsite.com\r\nContent-type: text/html; charset=iso-8859-1");

Thanks for the help!

Nmoleo
  • 11
  • 2
  • If it's going to spam you should look into additional header options, like setting the envelope address if it doesn't automatically match what you're defining in your above code. – Robert Aug 17 '17 at 18:38

2 Answers2

0

That could be a spam problem. You are probably using sendmail to send the actual email from the server. You need to take a look at the logs of the MTA (postfix?) In order to have more details.

whites11
  • 12,008
  • 3
  • 36
  • 53
0

Check your server's SMTP setting. Also it may go to SPAM folders of gmail or outlook, please check.