954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

error in subcription email

hi, i just tried to add the email function to my website so that when users sign in the recieve an email but i keep getting this error. does anybody know what's wrong:

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\Program Files\wamp\www\practice\sbdjobs\signup11.php on line 110

here is the code that contains the email function:

//start building signup email
$msg = "<p><b>Name:</b> '.$fname. ''.$lname.'</p>";
$msg .="<p><b>Company Name:</b> '.$compname.'</p>";
$msg .="<p>Thank you for signing up with sbdjobs.com. You can log in anytime to add, edit or view jobs</p>";
$to = "'.$fname. ''.$lname.'<'.$con_email.'>";
$subject = "Registration with sbdJobs.com";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: sbdJobs.com' . "\r\n";
$headers .="'.$fname. ''.$lname.'<'.$con_email.'>";

//send mail
mail($to, $subject, $msg, $headers);

everything worked fine before i added this function. my php ini file looks like this:

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

; For Win32 only.
;sendmail_from = [email]tochi2k@hotmail.com[/email]


can anyone tell me what i did wrong.
thanks..

cali_dotcom
Junior Poster in Training
53 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

Most likely there is no smtp running at your server.

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 
Most likely there is no smtp running at your server.

i,m running the wamp server, do you think smtp is not running in the wamp server?

cali_dotcom
Junior Poster in Training
53 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

I'm sure it is not running. There is a thread about it on the wampserver forum. You would be able to use e.g. phpMailer using a GMail account, or another smtp account that will let you connect.

pritaeas
Posting Expert
Moderator
5,480 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You