Hey ppl,

I am using wampserver for my Website development...

Now, I want to send mail to a particular user from mysql table...

when i use the mail function for PHP code

mail($mail_to,$mail_sub,$mail_mesg,$headers)

I am getting the error as follows

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 C:\wamp\www\update4.php on line 65
Failed to send the E-mail from Assignment Given to jolie@hotmail.com

Can ny 1 Help me PLZ

Thanx in advance...

Hey ppl,

I am using wampserver for my Website development...

Now, I want to send mail to a particular user from mysql table...

when i use the mail function for PHP code

mail($mail_to,$mail_sub,$mail_mesg,$headers)

I am getting the error as follows

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 C:\wamp\www\update4.php on line 65
Failed to send the E-mail from Assignment Given to jolie@hotmail.com

Can ny 1 Help me PLZ

Thanx in advance...

The reason for the error is two-fold.

1. You are using a production tool on your home PC which does not normally have a mail server installed and
2. WAMP does not install a mail server on your computer.

PHP's mail function almost always needs to be on a live server to be tested. It has to be ran on a server with a mail server already installed on it.

My 2¢. Hope this helps. :)

Hi,

Thanx for trying...

But i solved the prb...

I had to make some changes in the php.ini

go to the mailfunction in php.ini and change according to you domain

SMTP= smtp.[I]localhost[/I].com
sendmail_from = manager@[I]localhost[/I].com

tat's it... it worked perfectly...

The reason for the error is two-fold.

1. You are using a production tool on your home PC which does not normally have a mail server installed and
2. WAMP does not install a mail server on your computer.

PHP's mail function almost always needs to be on a live server to be tested. It has to be ran on a server with a mail server already installed on it.

My 2¢. Hope this helps. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.