PHP mail() function not working

Hello, I am having a problem sending mail with php while hosting my own website with apache on my mac. First of all I would like to note that I do not have a large background with web hosting and php. Everything that I did so far was just suggestions from online articles and other forums, so please include detail with any answers.
I have apache started, and my website hosted just fine. I can also view php pages so I know php is running too. My problem is using the php mail() function.
I have a simple form in my site who's action attribute is set to results.php. In the results.php file I have the mail() function (along with html code displaying "thank you...blah blah blah") sending info from the form to my email address. I never get an error on the php side, but my mail never gets sent.
Is there some type of setting in a config file that need to be turned on or changed?
Here is what I have done/modified so far from my research from online articles. i dont know what some of them mean, but followed the steps correctly:
Edited the /etc/hostconfig file and added the line MAILSERVER=-YES-
Edited the /etc/postfix/main.cf file and uncommented the #myhostname = ...line and made it "myhostname = localhost" (without quotes)
Edited the php.ini file to the following - The line under where it says
; For unix only. You may supply arguments as well (default: "sendmail -t -i")
Sendmail_path = usr/sbin/sendmail -t -i
I opened the mail.log file and here are some entries from the other day:
Code:
Jul 9 08:16:50 new-host postfix/master[689]: daemon started -- version 2.4.3, configuration /etc/postfix
Jul 9 08:16:50 new-host postfix/qmgr[691]: 4B4DC2E8331: from=<[email protected]>, size=323, nrcpt=1 (queue active)
Jul 9 08:16:50 new-host postfix/qmgr[691]: 7A8242EE3C0: from=<[email protected]>, size=280, nrcpt=1 (queue active)
Jul 9 08:16:50 new-host postfix/qmgr[691]: B1C052EE3C4: from=<[email protected]>, size=280, nrcpt=1 (queue active)
Jul 9 08:16:50 new-host postfix/qmgr[691]: C281C2EE3C5: from=<[email protected]>, size=327, nrcpt=1 (queue active)
Jul 9 08:16:50 new-host postfix/smtp[694]: 4B4DC2E8331: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=213262, delays=213261/0.05/0.86/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
Jul 9 08:16:51 new-host postfix/pickup[690]: 0F5D22EE4DB: uid=70 from=<_www>
Jul 9 08:16:51 new-host postfix/cleanup[692]: 0F5D22EE4DB: message-id=<20100709121651.0F5D22EE4DB@localhost>
Jul 9 08:16:51 new-host postfix/qmgr[691]: 0F5D22EE4DB: from=<[email protected]>, size=333, nrcpt=1 (queue active)
Jul 9 08:16:51 new-host postfix/smtp[695]: 7A8242EE3C0: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=27074, delays=27073/0.02/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
Jul 9 08:16:51 new-host postfix/smtp[697]: C281C2EE3C5: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=26817, delays=26816/0.02/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
Jul 9 08:16:51 new-host postfix/smtp[696]: B1C052EE3C4: to=<[email protected]>, relay=relay.verizon.net[206.46.232.11]:25, delay=27174, delays=27173/0.01/1.1/0, dsn=4.0.0, status=deferred (host relay.verizon.net[206.46.232.11] refused to talk to me: 571 Email from 74.102.108.224 is currently blocked by Verizon Online's anti-spam system. The email sender or Email Service Provider may visit http://www.verizon.net/whitelist and request removal of the block. 100709)
Jul 9 08:17:23 new-host postfix/smtp[694]: connect to mx1.comcast.net[76.96.62.116]: Operation timed out (port 25)
Jul 9 08:17:50 new-host postfix/master[689]: master exit time has arrived
Any other suggestions on how to get this to work? I have also created a simple php file that sends mail without retreiving info from a form and also tried using several different email addresses to send to and from, but still nothing

Edited the /etc/postfix/main.cf file and uncommented the #myhostname = ...line and made it "myhostname = localhost" (without quotes) Change that to mail.yourispname.com Then run sudo postfix reload and see if it sends mail. The reason being, is that you don't have a fully qualified domain name.
And make that reflective in your mail() function file/template.
Message was edited by: doug pennington

Similar Messages

  • How to get PHP mail() function to WORK?

    The topic title speaks for itself. I only want the exact following code to actually send an e-mail, just as it does on any external server:
    <?php
    mail(<i>an e-mail address</i>, <i>a subject</i>, <i>some text</i>);
    ?>
    Is it possible?
    I have the sendmail_path set to /usr/sbin/sendmail -t -i in php.ini, and MAILSERVER=-YES- in hostconfig.
    I would like to avoid using sendmail's -f option if possible (this does not work for all e-mail addresses anyway).
    Mac mini Core Duo   Mac OS X (10.4.7)  

    Hi Neithan,
       If, as your profile indicates, you are using Tiger, you are using postfix when you use the "sendmail" command. Sendmail is no longer installed but postfix comes with an "emulator" to keep legacy stuff from breaking. It's still a good command line method for sending mail.
       I'm not sure if setting MAILSERVER=-YES- causes postfix to listen on the smtp port or just for local connections. However, I thought that local connections were sufficient to send mail. Try it and if it doesn't work use Postfix Enabler. Just remember that changing the hostconfig file doesn't take effect until the next reboot. (or run of SystemStarter)
       Also remember that most ISPs don't accept mail from unrecognized machines anymore.
    Gary
    ~~~~
       Money isn't everything -- but it's a long way ahead of
       what comes next.
             -- Sir Edmond Stockdale

  • The search function on my apple mail is not working.

    The search function in Apple mail is not working.  When I type in something to search by, the results are not showing up. 
    I've clicked on "All" on the search requirements to include all of my mailboxes.
    I've also tried rebuilding the mailboxes with no results.
    Has anyone else had this issue?

    Is Spotlight working?

  • The search function on my "sent" mail does not work - can anyone help?

    The search function on my "sent" mail does not work. When I type in more than two letters into the saerch box - the sent mail screen goes blank. Any ideas how to fix this? Apple technical support has not been much help for the past five days...

    As this is the forum for the MacBook Pro hardware, your question will be better answered in the OS X Snow Leopard forum where the Mail app is discussed.

  • Can't get PHP's mail() function to work on local Apache install

    I'm using Leopard and installed all available updates. I've done a clean install of Leopard, so no Tiger upgrade.
    I've installed the latest stable versions of Apache, PHP and MySql through MacPorts/command line in Leopard. So far so good, everything works except for PHP's mail() function.
    Does anyone know how to get PHP's mail() function to work on my localhost? Searching the web through Google taught me it's impossible to get it to work under Leopard but I find that hard to believe. Can anyone help me out?

    Any help appreciated.

  • MDX -Children count function Not working in Case statement

    Hi,
    I am trying to create set when you slice with the Hierarchy member is leaf level , I want a output only that Leaf level .
    and When I slice with  the parent level , it has to give all the members below that parent level.
    But the problem here is when I select child member or leaf member , The first condition in the Case is not working
    WITH SET
    TESTSET AS
    CASE
    WHEN
     [Dimension].[Hierarchy].currentmember.children.count<0
    THEN
     [Dimension].[Hierarchy].currentmember
    ELSE
     DESCENDANTS([Dimension].[Hierarchy].Currentmember,,AFTER)
    END
    SELECT
    WBSSET ON 1,
    {} on 0
    FROM
     (SELECT {[Dimension].[Hierarchy].&[10]} ON COLUMNS FROM [CubeName])
    Thanks,
    Santosh

    Hi Santosh,
    I don't think Children count function not working in case statement, I have tested it on my local environment, here s the sample query for you reference.
    with member
    testset as
    case
    when
    [Geography].[Geography].currentmember.children.count<10
    then "X"
    else "OK"
    end
    select testset on 0,
    {[Geography].[Geography].[Country].members} on 1
    from
    [Adventure Works]
    In your scenario, the issue might be caused by the query isself, you can try to use IsLeaf Funcion to achieve your requirement. Please refer to the links below.
    http://msdn.microsoft.com/en-us/library/ms144932.aspx
    http://www.databasejournal.com/features/mssql/article.php/3633696/MDX-Operators-The-IsLeaf-Operator--Conditional-Logic-within--Calculations.htm
    http://www.mdxpert.com/Functions/MDXFunction.aspx?f=22
    Regards,
    Charlie Liao
    TechNet Community Support

  • Add to address book function NOT working.

    For some reason the "add to address book" function in mail is not working. I option click an address in a received email, select add to address book - then go into my address book and it's not been added. Also when in Mail and I type in an address for an email that I've recently sent it NORMALLY autofills the address in. This is not working either. WTH?
    thanks.

    Hi,
    I'm having the same problem running OS 10.6.6, Mail 4.4 (1082), and Address Book 5.0.3 (875).
    When I click the drop-down for an email address in Mail or ctrl-click the email address and choose "Add to Address Book", the address in Mail changes to just the user's name (the address disappears) so that it looks like the address has been added to Address Book. But the address has NOT actually been added. If I then try to "Open in Address Book", Address Book launches but the address displayed is the last address I had open, not the one I supposedly just added.
    I haven't rebuilt permissions, but I applied "Read & Write" to all contents of my Applications folder as me, i.e. using my username.
    More than a little bit frustrating!
    The header for this topic says "This question is not answered. "Helpful" answers available: 2 . "Solved" answers available: 1 .", but I ain't seein' either a helpful or a solved answer. Are they here and I'm just not seein' 'em?
    Have a care,
    James Norris
    http://home.wamego.net/jnorris
    http://www.linkedin.com/in/pjamesnorris

  • "Push" E-Mail still not working with iPhone!

    I'm not sure what the problem is here with Yahoo and Apple but to this day I still encounter very big issues with push E-Mail regarding Yahoo and Apple...it just doesn't work! I now have a new iPhone (2G, 16GB) because I dropped my old one and the screen cracked (cement ouch). Anyways I got my new phone last week (via eBay) and once again push mail is not working. I either have to manually check or mail comes in when it feels like it...in some cases HOURS later! Or if my phone is locked/asleep the mail doesn't come into my phone until I pick up my phone and start using it. Yesterday I went to go use my phone, I slid the slider to unlock it to bring me to my home screen, the mail icon showed no mail. The next thing I know all this mail starts pouring into my phone (22 messages to be exact)! I was like geeze...this is so messed up!

    Push email continues to not function properly for me as well. The only time it ever works is if I'm actively on the phone after its been sleeping for a while, or when it polls for my other email accounts (in which case I get my "push" email at the same intervals as my regular email, making push worthless).
    None of the other functions of the iPhone does this. When I receive a call or SMS text message, my phone notifies me immediately. What is the purpose of having "push" email that notifies me when I received new mail if I have to still manually check my device? This has been one of the iPhone 3G's weaknesses since launch and STILL has yet to be fixed.
    Running iPhone 2.2. Software 2.2.1 did not address any changes with Mail.

  • IPhone 4s Voice mail notification not working after switching from Verizon to PagePlus.

    iPhone 4s Voice mail notification not working after switching from Verizon to PagePlus.  How can I get the notifications working?

    Contact your carrier - voicemail, and visual voicemail, is a carrier feature.

  • My outgoing mail is not working after the upgrade OS to mavericks. my mail client version is 7.1 . please help me resolve this issue

    My outgoing mail is not working after the upgrade OS to the mavericks. my mail client version is 7.1 . please help me out resolve this issue

    Please let me know , How we can reinstall apple mail ? .
    1 . We updated OS to mavericks few machine in last december and still does't works SMTP (Out going mail) on those MAC.
    2.  After that most recently we updated OS to mavericks few machine those are working will with SMTP server .
             a)Not showing any SMTP connection in TCP trace ,
             b) Connection docter every time Says "Connecting to the server "
    3, Then we have installed thunderberd (another mail) client on maverick os, which OS related to apple mail client not woking . It seems other mail client is working well with SMTP server .
    Please help me .
    Thanks,
    Ranesh..

  • Not able to sign into Blackberry Protect. Backup and Restore function not working. "Your device isn't associated with a Blackberry ID"

    Not able to sign into Blackberry Protect.  Backup and Restore function not working. Message is: "Your device isn't associated with a Blackberry ID."  My Blackberry Messenger and Blackberry World is working fine so I am sure its not an ID issue on the phone.  I can sign into Link, Blackberry.com and Protect.  I see my device in Protect but cannot send messages or view it on a map.  Times out with cannot reach device message.  BB Protect on Device has a swirling circle beside the on/of switch.  Cannot turn off.  
    I have deleted Link and re-installed.
    I have reset phone to default(factory) and signed in. 
    OS level is 10.2.1.3062
    BB Link is 1.2.3.56
    Solved!
    Go to Solution.

    I managed to figure this out myself. I had to delete the device from the Blackberry Protect website.  protect.blackberry.com.  I wiped my device again and signed in with my Blackberry ID.  I dont know if the step of wiping was necessary as I did not try my backup with the current configuration on the device following the delete.  Restore is in progress for me!

  • Safari and mail does not work

    Safari and mail is not working on my new iPad with iOS 5.1.1, tried every trick in the book but to no avail. Please suggest in case I want to update my ios5.1.1 as I fear that it might have corrupted somehow, what's the way to do it. I don't want to upgrade to higher iOS versions. Thanks

    Close Safari and Mail app on the Task Bar and re-launch.
    1. Double-click the Home button to reveal Task Bar
    2. Hold Safari and Mail app down for a second or two until you see the minus sign
    3. Tap the minus sign to close app
    4. Tap area above Task Bar to return to Home screen

  • Mail is not working. The app opens because I see a light on under "Mail" in the dock.

    Mail is not working. The app opens because I see a light on under "Mail" in the dock, and I see the menu at the top of my screen, but I don't see the app itself or any windows. It is like it is running in the background, but I can't see it. Everthing is subdued when I click on the choices up in the menu. I have tried "Force Quit" and then re-opening the mail app several times, and have rebooted my notebook twice. What is weird is that this started right after I changed my password in a browser (it is a gmail account). I went into the System Preferences on my MacBook and changed my password there as well, so it should be setup properly to open. I am running Mac OS X Lion 10.7.5.   Any help anyone can provide is much appreciated.

    The current Mail version for 10.6.8 Snow Leopard is 4.6 (1085).   Run Software update or the combo updater ... Mac OS X 10.6.8 Update Combo v1.1

  • Mail search not working + Spotlight keeps indexing

    I have an old problem that has resurfaced after creating a new user on my Mac. Mail search brings no results and Spotlight is constantly indexing - day in, day out. It never seems to get there. I tried turning my hard drive to private in Spotlight settings and then taking it out. Previously Spotlight seemed to get bogged down with external drives now it's stuck indexing my Mac.
    Any advice? Is there a way I get unstick this?

    I can't believe that Apple have STILL not sorted this out. I haven't created a new user (so it's nothing to do with that), but Mail.app won't find anything when searching "Entire Message" in the current Mailbox or in "All Mailboxes". This has been ongoing since Leopard was first released, and we are now up to 10.5.8 without this being fixed.
    Here are some of the reports:
    Topic : Spotlight does not search Mail messages
    http://discussions.apple.com/thread.jspa?threadID=1366101
    Topic : Search "Entire Message" returns "0 Found" in mailboxes
    http://discussions.apple.com/thread.jspa?threadID=1341832
    Topic : Spotlight died on me
    http://discussions.apple.com/thread.jspa?threadID=1226645
    Topic : I can't search through my inbox!
    http://discussions.apple.com/thread.jspa?threadID=1387827
    Topic : Leopard's Spotlight doesn't search Mail messages
    http://discussions.apple.com/thread.jspa?threadID=1219030
    Topic : Mail Search
    http://discussions.apple.com/thread.jspa?threadID=1347387
    Topic : Mail Won't Search
    http://discussions.apple.com/thread.jspa?threadID=1204827
    Topic : Search does not work
    http://discussions.apple.com/thread.jspa?threadID=1254966
    Topic : Mail search not working
    http://discussions.apple.com/thread.jspa?threadID=1289253
    Topic : Unable to Search Mailbox
    http://discussions.apple.com/thread.jspa?threadID=1232504
    Topic : Why is Search in Mail.app busted?
    http://discussions.apple.com/thread.jspa?threadID=1403758
    Topic : Mail Search comes up empty
    http://discussions.apple.com/thread.jspa?threadID=1378473
    Topic : Search "Entire Message" not working with Smart Mailboxes?
    http://discussions.apple.com/thread.jspa?messageID=6548355&#6548355
    Topic : Mail searches yield no results! Smart mailboxes also yield no results!
    http://discussions.apple.com/thread.jspa?threadID=1395508
    Topic : 10.5.2 Mail.app search still not working (Entire Message)
    http://discussions.apple.com/thread.jspa?threadID=1389466

  • I updated to iOS 6 on my iphone 4 and updated my macbook pro with and now my mail is not working at all on my iPhone.  I can receive/send on my laptop, but not my iPhone!! Can someone help?

    i updated to iOS 6 on my iphone 4 and updated my macbook pro  and now my mail is not working at all on my iPhone, whether on wifi or 3G.  I can receive/send on my laptop, but not my iPhone!! Can someone help?

    Which email provider are you using?  If it's Gmail, try unlocking your account here: https://accounts.google.com/DisplayUnlockCaptcha.

Maybe you are looking for

  • Making separate iTunes accounts on the same computer

    My brother just got an iPod, and he keeps using my downloads so I can't put them on a second device. Is there a way to make it so you have to log in to start doing anything with iTunes?

  • How do I converting PDF to editable Word?

    I've follwoed the onscreen directions multiple times over the past week but have been unable to acheive a successful conversion. The uploading file to Adobe ExportPDF online monitor just keeps going round and round in circles for HOURS! There is no s

  • IPod slideshow

    Can anyone tell me how to access my nano's slideshow? I know there are pictures on it because they show up when the songs are playing.

  • How do i delete duplicate photos in iphoto

    What is the easiest way to delete duplicate photos in iphoto at one time?  I have 8,000 photos to go through with many duplicates.

  • I accidently put iphoto in Time machine. Iphoto won't open on desktop. Help?

    I must have accidently transfer my iphotos to my time machine. At least that's suggested by the error box. Help? Also, this all started by trynig to backup time capsuke with a seagate backup plus for mac.