This is a discussion on mail() function help! within the PHP Language forums, part of the PHP Programming Forums category; Can someone help me with the mail() function??? The below is just to get myself going but I can't ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Can someone help me with the mail() function???
The below is just to get myself going but I can't seem to get it working... is there something else I should be doing? I checked phpinfo() and the sendmail values are below. Those mean it's turn on right? sendmail_from me@localhost.com sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i My code is as follows: mail ('abersparky@gmail.com', 'New Comment Submitted for Approval', 'Approval informational'); THANKS!!! |
|
|||
|
abersparky@gmail.com says...
> Can someone help me with the mail() function??? > My code is as follows: > > mail ('abersparky@gmail.com', 'New Comment Submitted for Approval', > 'Approval informational'); Try: $to = 'abersparky@gmail.com'; $subject = 'New Comment Submitted for Approval'; $message = 'Approval informational'; $headers = ''; $params = ''; if(mail($to, $subject, $message, $headers, $params)) { echo 'No problem in mail function'; } else { echo 'Oops, mail function problem'; } If it is not a mail function problem it may be that gmail is filtering it out as possible spam. Try: $params = '-f<insert a known real sender email address here>'; See: http://au.php.net/manual/en/function.mail.php and search for specific gmail issues. GM |