SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php mail() localhost

    I'm currently working on a very simple form that will automatically send a confirmation email to the address that's suplied in the form. Think a simple newsletter signup application. Before I upload everything to my remote host I want to check everything is working first by using the localhost server setup on my machine. Can somebody please help me configure it so that the php mail() will work from my localhost, or tell me how I can test the application before uploading to my remote host. I use a MacBook Pro running OS X 10.4.11. I have a standard php and apache setup. When I run phpinfo() sendmail_from has "no value", sendmail_path = "/usr/sbin/sendmail -t -i", SMTP = "localhost" and SMTP port = "25".
    Many thanks.

  2. #2
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,443
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    I think you will still need to "Send" it via a server somewhere.

    On my Windows localhost setup with XAMPP I have:
    PHP Code:
    [mail function]
    ; For 
    Win32 only.
    SMTP mail.your_server.com
    smtp_port 
    25

    ; For Win32 only.
    sendmail_from anthony@home.com

    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ;
    sendmail_path "F:\xampp\sendmail\sendmail.exe -t"

    Force the addition of the specified parameters to be passed as extra parameters
    to the sendmail binaryThese parameters will always replace the value of
    the 5th parameter to mail(), even in safe mode.
    ;
    mail.force_extra_parameters 
    I would say you need to use your hosts server for the value here:
    SMTP = mail.your_server.com

    I think "sendmail_from" can be anything you like - it just shows up as the senders address in the header.
    Last edited by Rubble; Apr 12, 2009 at 11:44. Reason: Added sendmail_from line

  3. #3
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    516
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I use imap_mail() and for testing purposes I just print the arguments. For a real test you need a mail server. To activate the mail server on your Mac, try this:

    http://xanana.ucsc.edu/~wgscott/xtal...Server_on_OS_X

    or this

    http://www.david-reitter.com/software/osxpostfix.html
    Denny Schlesinger
    web services


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
  •