Jump to content

mail()


westman

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...