Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts

    mail() Am I missing something?

    I downloaded a free SMTP server called Free SMTP server (imagine that.) And I have a PHP script that looks like this:

    PHP Code:
    $to="My Email Address";
    $subject="Yo!";
    $message="Hi!";
    mail($to$subject$message) or die("Failed"); 
    And it's of course showing me, failed. Any other settings or things I forgot to do?
    If you're reading this, it may already be too late!

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    did you configure your php.ini to use it?
    I think I used fake sendmail in the past:
    http://www.glob.com.au/sendmail/

    what does it say if you take off the ' or die(...)" ?

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    If I take off the or die it doesn't say anything. Here's the general mail area of my php.ini:

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25

    ; For Win32 only.
    sendmail_from = confirmation@betaboards.gotdns.com
    If you're reading this, it may already be too late!

  • #4
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can you telnet into your local SMTP server and send email?
    follow these directions..
    http://www.yuki-onna.co.uk/email/smtp.html

    is display_errors on in your php.ini ? does the SMTP server say that it processes it or anything?

  • #5
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    What is my local SMTP server again? And yes, display_errors says On.
    If you're reading this, it may already be too late!

  • #6
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    your local SMTP server is localhost which points to 127.0.0.1 (ping localhost to see for yourself)

  • #7
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    My SMTP server (free SMTP server) lists my email address under active connections, but I never get the email.
    If you're reading this, it may already be too late!

  • #8
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you send an email to the address using a valid smtp server, does it work?

  • #9
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I'm not really familiar with SMTP servers so I don't know.
    If you're reading this, it may already be too late!

  • #10
    Regular Coder
    Join Date
    Dec 2004
    Location
    Manchester, UK
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's a quick way to debug:

    Download Swift Mailer from swiftmailer.org. Tell it to connect to your SMTP server on locahost, try sending an email and print_r($mailer->transactions) to see what happened. The errors plugin will help to show you the obvious too.

  • #11
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ok, how do I tell it to do that, specifically?
    If you're reading this, it may already be too late!

  • #12
    Regular Coder
    Join Date
    Dec 2004
    Location
    Manchester, UK
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Digger3000
    Ok, how do I tell it to do that, specifically?
    Did you read the documentation?

    Namely: http://www.swiftmailer.org/documentation/33#view

  • #13
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Oh right, documentation. Thanks, that worked.
    If you're reading this, it may already be too late!


  •  

    Posting Permissions

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