Jump to content

Mail Function


toreachdeepak

Recommended Posts

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

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

  • 3 weeks later...

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...