toreachdeepak Posted September 22, 2009 Report Share Posted September 22, 2009 (edited) 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";}?> Edited September 22, 2009 by DeepakBhatia Link to comment Share on other sites More sharing options...
justsomeguy Posted September 23, 2009 Report 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 Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now