Can't figure out Mail()
Posted: Thu Mar 23, 2006 11:20 pm
feyd | Please use
I'm running an Apache web server on an OSX machine and I changed the following lines in my php.ini file:
The mail function seems to run without any problem, but the message never reaches the destination. Any thoughts?
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hey - a seemingly very simple issue is giving me more trouble than it should be. I'm trying to get php to send an email. Here's my code:Code: Select all
$to = 'example@host.com';
$subject = 'the subject';
$message = 'hello';
$headers = "From: example@host.com\r\n
Reply-To: example@host.com\r\n
X-Mailer: PHP/" . phpversion() ;
if(@mail($to, $subject, $message, $headers))
echo "mail was sent successfully" ;
else
echo "&%*@!!" ;Code: Select all
;sendmail_from = example@host.com
;sendmail_path = /usr/sbin/sendmail -tfeyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]