Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > PHP mail() not working for me

PHP mail() not working for me
Thread Tools
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Jul 23, 2001, 01:32 PM
 
I've been trying to get the mail() function to work and so far I haven't had any luck. First, I found out sendmail isn't enabled by default in OS X. I tried to get that to work with no sucess so instead I followed the advice of some MUG and installed "postfix" or whatever it's called. Now, at least my computer is working as an SMTP server. I can tell Mail.app to use "localhost" as the SMTP server and the mail goes through just fine.

But, now I can't figure out why mail() isn't working in PHP. Are there any steps I need to take on the PHP side? Maybe something with php.ini? I haven't tried much because I don't know where to start.

TIA
     
Grizzled Veteran
Join Date: Sep 1999
Location: Boston, MA USA
Status: Offline
Reply With Quote
Jul 23, 2001, 01:56 PM
 
Originally posted by Xeo:
<STRONG>I've been trying to get the mail() function to work and so far I haven't had any luck. First, I found out sendmail isn't enabled by default in OS X. I tried to get that to work with no sucess so instead I followed the advice of some MUG and installed "postfix" or whatever it's called. Now, at least my computer is working as an SMTP server. I can tell Mail.app to use "localhost" as the SMTP server and the mail goes through just fine.

But, now I can't figure out why mail() isn't working in PHP. Are there any steps I need to take on the PHP side? Maybe something with php.ini? I haven't tried much because I don't know where to start.

TIA</STRONG>
There is a setting in PHP.ini that explicitly sets the command to use for mail. I have no experience with Postfix, so can't tell you what the command would be, but you can check postfix's docs.

To get sendmail working, check the following URLs:
http://www.publicsource.apple.com/bu...s/2695647.html http://www.publicsource.apple.com/bu...l/2547692.html

and this piece of info:

==========================
Okay, first, remove the "-" from both sides of your hostname in /etc/hostconfig
Second, run "sudo chmod g-w /" You'll probably have to do this everytime
you update OS X via Software Update or if you run an updater.
Third, run "open -e /System/Library/StartupItems/Sendmail/Sendmail" ...
towards the bottom you'll see the line that launches sendmail followed by
a "&" Delete the "&"
Finally, run "sudo chmod 1777 /var/mail"
==========================

The URLs should give you an idea of what the prob is. The bottom bit explains how to address it.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:35 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2