0

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...

Edited by kuteinheart: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by kuteinheart
0

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. :)

0

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. :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.