toreachdeepak Posted September 22, 2009 Share Posted September 22, 2009 Hi,I am not sure why does below program doesn't send mail to $to. Even though I get "Mail Sent". This is happening on linux.<?php$to = 'b.kumar@nechclst.in';$subject = 'the subject';$message = 'hello';$headers = 'From: deepak.bhatia@nechclst.in' . "\r\n" . 'Reply-To: deepak.bhatia@nechclst.in' . "\r\n" . 'X-Mailer: PHP/' . phpversion();if(mail($to, $subject, $message, $headers)){ echo "Mail Sent";}else{ echo "Mail not sent";}?> Link to comment Share on other sites More sharing options...
justsomeguy Posted September 23, 2009 Share Posted September 23, 2009 If the mail function returns true that means the mail server accepted the mail for delivery. If you have access, check the mail server logs to see if there's a problem sending or receiving. If you're using a cPanel server then there's a log for exim you can check to see messages from the outgoing mail server. Link to comment Share on other sites More sharing options...
PravinBhat Posted October 12, 2009 Share Posted October 12, 2009 Look at this.........$to = 'b.kumar@nechclst.in';$subject = 'the subject';$message = 'hello';$headers = 'From: deepak.bhatia@nechclst.in' . "\r\n" .'Reply-To: deepak.bhatia@nechclst.in' . "\r\n" .'X-Mailer: PHP/'...........Is this a way to initialize a variable ???Use "the subject" instead of ' ' ha ?? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.