saumya Posted March 24, 2007 Share Posted March 24, 2007 hi, I have tried with below code $uName='sam'; $to = "2saumyaray@gmail.com"; $from = 'r.saumya@yahoo.com'; $subject = "site feed back"; $message = 'message'; $headers = "From: $from\r\n"; $config = "-fwebmaster@mycompany.com"; $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 :( !!!! Quote Link to comment 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()); Quote Link to comment 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: webmaster@noreply.com' . "\r\n" . 'Reply-To: webmaster@noreply.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $sent = mail($to, $subject, $message, $headers); if ($sent){ echo "Message Sent!";} else { echo "Message could not be sent";} Quote Link to comment 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" !! Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 24, 2007 Share Posted March 24, 2007 Please post your whole script here. Quote Link to comment 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='2saumyaray@gmail.com'; $to= '$email'; $subject = 'A Subject'; $message = 'Hello there'; $headers = 'From: webmaster@noreply.com' . "\r\n" . 'Reply-To: webmaster@noreply.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $sent = mail($to, $subject, $message, $headers); if ($sent){ echo "Message Sent!";} else { echo "Message could not be sent";} Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
MikeK Posted March 24, 2007 Share Posted March 24, 2007 $to='2saumyaray@gmail.com'; Quote Link to comment Share on other sites More sharing options...
shaunrigby Posted March 24, 2007 Share Posted March 24, 2007 MikeK what have you changed? Quote Link to comment Share on other sites More sharing options...
saumya Posted March 24, 2007 Author Share Posted March 24, 2007 $to='2saumyaray@gmail.com'; $subject = 'A Subject'; $message = 'Hello there'; $headers = 'From: webmaster@noreply.com' . "\r\n" . 'Reply-To: webmaster@noreply.com' . "\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 Quote Link to comment 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... Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
shaunrigby Posted March 24, 2007 Share Posted March 24, 2007 sorry not from my bad Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.