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 = tochi2k@hotmail.com


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

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?

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.

This article has been dead for over six months. Start a new discussion instead.