Jump to content

PHP Mail NOT WORKING on UNIX (Mac OS X)


Recommended Posts

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

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! 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.