westman Posted December 18, 2017 Share Posted December 18, 2017 I have been using the same script for years to send an email. However, php 7.1 on goddady is new to me, so that mite be the problem. Here is what I have. $message = wordwrap($message,70); $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers); I am not getting emails. What is the problem here? Link to comment Share on other sites More sharing options...
justsomeguy Posted December 18, 2017 Share Posted December 18, 2017 You have $to defined somewhere, right? Make sure that the from address is set to the same domain as your web site. Link to comment Share on other sites More sharing options...
westman Posted December 18, 2017 Author Share Posted December 18, 2017 Full code below $to = $email; $from = "system@site.com"; $subject = "hello"; $message = '<html> <body bgcolor="#FFFFFF"> Dear Member, <br /><br /> hello <br /><br /> </body> </html>'; $message = wordwrap($message,70); $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers); Link to comment Share on other sites More sharing options...
justsomeguy Posted December 18, 2017 Share Posted December 18, 2017 $to is just set to another variable. Soo.... that variable is set to an actual email address, right? If you're not sure then print the values of everything before you send the email. Link to comment Share on other sites More sharing options...
westman Posted December 18, 2017 Author Share Posted December 18, 2017 $email works fine. I can print it to the page and see the output. Link to comment Share on other sites More sharing options...
westman Posted December 19, 2017 Author Share Posted December 19, 2017 Found the problem. It was my subject. Goddady was blacking as spam. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now