Jump to content

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 = "blablabla@sympatico.ca";
$subject = "PHP Mail Test";
$body = "Testing.\n .
       This is a basic text PHP Mail Function test";
$headers .= 'From: no-reply@nobody.ca' . "\n";
if (mail($to, $subject, $body, $headers)) {       
 echo("<p>Mail sent to $to</p>");
} else {                 
 echo("<p>Message delivery failed</p>");
}
?>

blablabla@sympatico.ca 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 = me@example.com

; 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

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.