email - php mail function problem -


this code far

function send_email() {  $email = $_post['signup-email']; $firstname = $_post['firstname']; $lastname = $_post['lastname'];  $to = "the1nz4ne@hotmail.com"; $subject = "email ratemylife.com"; $body = "hi ,$firstname $lastname, email ratemylife.com"; $headers = "from:info@iphoneappgmz.com";  mail($to, $subject, $body, $headers);  exit();  }  $existingsignup = mysql_query("select * signups signup_email_address='$email'");    if(mysql_num_rows($existingsignup) < 1){     $date = date('y-m-d');     $time = date('h:i:s');     $password = md5($passwd);     $insertsignup = mysql_query("insert signups (signup_email_address, signup_date, signup_time, firstname, lastname, password, year, day, month, gender) values   ('$email','$date','$time','$firstname', '$lastname', '$password', '$year', '$day', '$month', '$gender')");     if($insertsignup){ //if insert successful        send_email();     } 

the email not send...

thanks cant figure out problem.

there can multitude of reasons... on windows or linux server?

check phpinfo see if sendmail correctly configured (sendmail_path).

if correctly configured, check why emails not being sent in smtp server log messages, check more details: http://pt.php.net/manual/en/function.mail.php#101588

if don't have sendmail correctly configured, can still use account have in smtp server send emails. should use php lib facilitate work, example, check this: http://swiftmailer.org/

also, test php code send email , see if works:

mail('youremail@example.com', 'my subject', 'test message'); 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -