SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP mail(); won't work on XAMPP 1.0.1 on OSX 10.5

    (complete PHP/Server-side n00b here)

    Hi there

    I'm coding PHP on Mac OSX 10.5 (Leopard) with the latest version of XAMPP (1.0.1) and I'm having trouble to see why my mail(); won't work. The code seems valid in every way, and it even loads the success statement which its instructed to echo when the function is complete. My only guess is that there is a setting somewhere in XAMPP that is stopping the mail(); from working.

    Any ideas as to what to do? Everything in XAMPP is at its default settings, if that is any help.


    Everything is newly installed and at its default including the php.ini file.

    here is what the current settings are (php.ini) :

    PHP Code:
     // default, untouched.
    [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 
    I am running this server locally and just want to test my contact form and a newsletter subscription form.


    Any ideas as to what I should do?

  2. #2
    SitePoint Addict
    Join Date
    Oct 2008
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe it is an issue with the sendmail binary? Not sure though, dont know much about mac and don't know if mac has this by default (I doubt it has). But in any case you have to have some mailing program on the server you are running php to get mail() working (and also configure php to use it). Also according to the settings you have there, the comments says it's only for win32. Maybe install some smtp server working on mac and try adding it to the config?
    http://fi.php.net/manual/en/mail.requirements.php

  3. #3
    SitePoint Member
    Join Date
    Jul 2009
    Location
    Devon, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The easiest thing to do would be use the phpmailer class (search for that if you need to) and set the parameters so that is uses your SMTP mail server. Then when you put the script onto your actual live web server, it will work without any changes (or at the most you will need to change the SMTP host setting.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •