problem with mail() - "failed to connect" error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
verabug
Forum Newbie
Posts: 16
Joined: Tue Jun 11, 2002 7:53 pm
Location: San Francisco, CA
Contact:

problem with mail() - "failed to connect" error

Post by verabug »

Here is my script for sending an email to a new user after they register:

Code: Select all

$eaddress = $email;

$subject = "blablabla";

$msg = "<html><head></head><body bgcolor="#ffffff">
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#006699">Hi $username!<br><br>
blablabla<br><br></body></html>";

$headers = "From: me@somewhere.edu\nContent-Type: text/html";

mail($eaddress, $subject, $msg, $headers);
This is the error message I get:
Warning: Failed to Connect in c:\program files\apache group\apache\htdocs\eq_register.php on line 101
Anybody know why?
Zmodem
Forum Commoner
Posts: 84
Joined: Thu Apr 18, 2002 3:59 pm

Post by Zmodem »

Could be a lot of reasons.

- Is there an SMTP server installed on the machine your script is running on?
- If UNIX, is Sendmail working properly?
- Is the configuration of email set properly in php.ini ?
Post Reply