saumya Posted March 24, 2007 Share Posted March 24, 2007 hi, I have tried with below code $uName='sam'; $to = "[email protected]"; $from = '[email protected]'; $subject = "site feed back"; $message = 'message'; $headers = "From: $from\r\n"; $config = "[email protected]"; $success = mail($to, $subject, $message, $headers,$config); if ($success) echo('msg=Your message has been sent successfully.'); else echo "msg=An error occurred when sending the email."; Result is showing the confirmation message, but There is actually no mail sent :( !!!! Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/ Share on other sites More sharing options...
MikeK Posted March 24, 2007 Share Posted March 24, 2007 Try this $msg2 = "A message"; $subject2 = "A Subject"; mail("$email", $subject2, $msg2, "From: $mail_master\r\n" . "Reply_To: $mail_master\r\n" . "X-bounce-to: $mail_master\r\n" . "X-Mailer: PHP/" . phpversion()); Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214213 Share on other sites More sharing options...
DeathStar Posted March 24, 2007 Share Posted March 24, 2007 [ code ][ /code ] Please! Try this emailing script: $to = '$email'; $subject = 'A Subject'; $message = 'Hello there'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $sent = mail($to, $subject, $message, $headers); if ($sent){ echo "Message Sent!";} else { echo "Message could not be sent";} Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214216 Share on other sites More sharing options...
saumya Posted March 24, 2007 Author Share Posted March 24, 2007 hi DeathStar, thank you for the help. But now it says "Message could not be sent" !! Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214219 Share on other sites More sharing options...
DeathStar Posted March 24, 2007 Share Posted March 24, 2007 Please post your whole script here. Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214220 Share on other sites More sharing options...
saumya Posted March 24, 2007 Author Share Posted March 24, 2007 i have modified the script and now my php file contains the below code. now it says "message sent", I think this is because "if" condition is checked after the mail() function. But the problem is still there, no mail is sent but message is "mail sent" !! $email='[email protected]'; $to= '$email'; $subject = 'A Subject'; $message = 'Hello there'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $sent = mail($to, $subject, $message, $headers); if ($sent){ echo "Message Sent!";} else { echo "Message could not be sent";} Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214222 Share on other sites More sharing options...
shaunrigby Posted March 24, 2007 Share Posted March 24, 2007 Read the thread below,apparently it includes all major mail providers such as Gmail, Yahoo, Hotmail etc http://www.phpfreaks.com/forums/index.php/topic,131516.0.html Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214236 Share on other sites More sharing options...
MikeK Posted March 24, 2007 Share Posted March 24, 2007 $to='[email protected]'; Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214240 Share on other sites More sharing options...
shaunrigby Posted March 24, 2007 Share Posted March 24, 2007 MikeK what have you changed? Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214242 Share on other sites More sharing options...
saumya Posted March 24, 2007 Author Share Posted March 24, 2007 $to='[email protected]'; $subject = 'A Subject'; $message = 'Hello there'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $sent = mail($to, $subject, $message, $headers); if ($sent){ echo "Message Sent!";} else { echo "Message could not be sent";} no luck Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214244 Share on other sites More sharing options...
shaunrigby Posted March 24, 2007 Share Posted March 24, 2007 try changing the email address to an email that is from from a public provider such as hotmail, gmail yahoo etc if you do not have 1 pm me and i will set you up a temp pop3 account that i know works... Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214247 Share on other sites More sharing options...
saumya Posted March 24, 2007 Author Share Posted March 24, 2007 the email address is already a gmail address Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214253 Share on other sites More sharing options...
shaunrigby Posted March 24, 2007 Share Posted March 24, 2007 sorry not from my bad Link to comment https://forums.phpfreaks.com/topic/44113-mail-is-not-working/#findComment-214255 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.