westman Posted September 27, 2012 Share Posted September 27, 2012 hi again i got a sign up script that works, the only thing that does no work is mail()when my script runs i do not get an emailthis is my script.... $to = $signup_email;$from = "service@mysite.com";$subject = "Complete your registration";$message = '<html><body bgcolor="#FFFFFF">Hi ' . $signup_username . ',<br /><br />You must complete this step to activate your account with us.<br /><br />Please click here to activate now <br />http://www.mysite.com/activate/activation.php?id=' . $id . '&sequence=' . $db_password . '<br />If the URL above is not an active link, please copy and paste it into your browser address bar.<br /><br />Your Login Data is as follows: <br /><br />E-mail Address: ' . $signup_email . ' <br />Password: ' . $signup_password . ' <br /><br /> </body></html>';$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 September 27, 2012 Share Posted September 27, 2012 The code looks fine, make sure it's not going to a spam or trash folder. If you're running that on a test server, make sure it has a working email server that PHP is configured to use. Link to comment Share on other sites More sharing options...
birbal Posted September 27, 2012 Share Posted September 27, 2012 check return value of mail() to see it is successfully accepted by mail server or not. if it is your localhost you need a mail server running on it. if it is running a mail server check the spam folder of your reciving email. if still you are not getting any email check you mail server logs. Link to comment Share on other sites More sharing options...
westman Posted September 28, 2012 Author Share Posted September 28, 2012 i don't no what happened but i left the script and came back 12 hours later and it now works. i have no idea what the problem was, but the main thing is that it is working now Link to comment Share on other sites More sharing options...
oknoorap Posted October 4, 2012 Share Posted October 4, 2012 The idea of using mail() function is bad, you must using library like phpmailer, or you can using paid SMTP Server relay.. There is reason that mail service such as gmail, your mail will shown at spam folder. But if you're using smtp, google will marked your email as important email.mail() is basic php function that using port 25, so gmail or other mail service will be carefully marked email that sent by port 25. 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