Alice Wei wrote:
Hi, I have an issue here where I see no PHP errors on my mail
> function usage, and yet I am not getting the mail in the > desired account. Here is what I have for my PHP code:
$headers = "From: ajwei@xxxxxxxxxxxxx"; $to = "ajwei@xxxxxxxxxxxxx "; $subject = "Comments Regarding My Studio"; $body = "From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments"; mail($to, $subject, $body,$headers);
I don't see any way for you to know if there are any errors. Try this as a very basic start: $headers = "From: ajwei@xxxxxxxxxxxxx"; $to = "ajwei@xxxxxxxxxxxxx "; $subject = "Comments Regarding My Studio"; $body = "From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments"; $success=mail($to, $subject, $body,$headers); if ($success) { echo "Mail was sent successfully!"; } else { echo "Sending of mail failed!"; }
This is what I have in my PHP.ini: [mail function] ; For Win32 only. SMTP = smtp.live.com smtp_port = 587 ; For Win32 only. sendmail_from = ajwei@xxxxxxxxxxxxx ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = Yet, I don't see any mail in my ajwei@xxxxxxxxxxxxx Mailbox, can
> anyone on the list please give me some pointers on what I may have done wrong here?
Thanks for your help.
Thanks to the worldwide brotherhood of crooks known as spammers, sending e-mail these days isn't nearly as easy as PHP makes it look. You might wanna look into an "errors-to" header to help debug any problems with sender authorization, bad ports, etc. HTH, KDK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php