View Full Version : mail() Am I missing something?

06-17-2006, 04:14 AM
I downloaded a free SMTP server called Free SMTP server (imagine that.) And I have a PHP script that looks like this:

$to="My Email Address";
mail($to, $subject, $message) or die("Failed");

And it's of course showing me, failed. Any other settings or things I forgot to do?

06-17-2006, 04:20 AM
did you configure your php.ini to use it?
I think I used fake sendmail in the past:

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

06-17-2006, 04:22 AM
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

06-17-2006, 04:30 AM
can you telnet into your local SMTP server and send email?
follow these directions..

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

06-17-2006, 04:32 AM
What is my local SMTP server again? And yes, display_errors says On.

06-17-2006, 04:34 AM
your local SMTP server is localhost which points to (ping localhost to see for yourself)

06-17-2006, 04:37 AM
My SMTP server (free SMTP server) lists my email address under active connections, but I never get the email.

06-17-2006, 04:39 AM
if you send an email to the address using a valid smtp server, does it work?

06-17-2006, 04:41 AM
I'm not really familiar with SMTP servers so I don't know.

06-17-2006, 12:49 PM
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.

06-17-2006, 04:42 PM
Ok, how do I tell it to do that, specifically?

06-17-2006, 05:06 PM
Ok, how do I tell it to do that, specifically?

Did you read the documentation (http://www.swiftmailer.org/documentation/)?

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

06-17-2006, 05:58 PM
Oh right, documentation. Thanks, that worked.