Chunk1978 Posted February 28, 2007 Share Posted February 28, 2007 i keep reading "simply do this with PHPs built-in Mail() function"... wtfever! i've been trying to get this working for a week, and it's still a big mystery... i'm trying to set this up locally using Apache 1.3... my PHP script: <? $to = "[email protected]"; $subject = "PHP Mail Test"; $body = "Testing.\n . This is a basic text PHP Mail Function test"; $headers .= 'From: [email protected]' . "\n"; if (mail($to, $subject, $body, $headers)) { echo("<p>Mail sent to $to</p>"); } else { echo("<p>Message delivery failed</p>"); } ?> [email protected] isn't the real address my PHP.ini [i'm using MAC OS X (unix)] [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = [email protected] ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = "/usr/sbin/sendmail -t -i" ; 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 = the problem is that it keeps echoing that the mail has been sent, but i never receive anything... WHY isn't this working? please help... this is driving me crazy. thanks Link to comment https://forums.phpfreaks.com/topic/40622-php-mail-not-working-on-unix-mac-os-x/ Share on other sites More sharing options...
Chunk1978 Posted March 1, 2007 Author Share Posted March 1, 2007 i've been reading something about "Postfix"... i use Mac OS X 10.4, so apparently it uses postfix instead of sendmail... but even if i change my php.ini file to sendmail_path: /usr/sbin/postfix or sendmail_path: /usr/sbin/sendmail.postfix it still doesn't work... this is SO RIDICULOUS! Link to comment https://forums.phpfreaks.com/topic/40622-php-mail-not-working-on-unix-mac-os-x/#findComment-196606 Share on other sites More sharing options...
trq Posted March 1, 2007 Share Posted March 1, 2007 I'm not a Mac user though I run Linux so I asume its much the same. If you have postfix installed and configured properly you'll still need to configure a simple smtp client. Take a look at my reply in this thread as the same should apply to you. Hope this helps. PS: Are you sure you want to run a local mail server? Its really alot of work to keep them secure. Link to comment https://forums.phpfreaks.com/topic/40622-php-mail-not-working-on-unix-mac-os-x/#findComment-196882 Share on other sites More sharing options...
Chunk1978 Posted March 1, 2007 Author Share Posted March 1, 2007 i'm not exactly sure if i want to or not... but it seems that it's the only way i can test my PHP scripts with mail() functions... is there a better way to do this while using apache locally? Link to comment https://forums.phpfreaks.com/topic/40622-php-mail-not-working-on-unix-mac-os-x/#findComment-196896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.