Jump to content

Problem sending E-Mail using PHP5


Fedexpress

Recommended Posts

Dear Sir/Mam ,

 

Actually I am unable to send mail using php5 , i have enlisted the configurations of php.ini later . I surfed a bit and downloaded a Free SMTP Server but I am completely clueless as to how use it

 

This is the c :-*nfiguration in php.ini file

 

[mail function]

; For Win32 only.

 

SMTP = smtp.my.server.net

smtp_port = 25

 

; For Win32 only.

sendmail_from = [email protected]

 

This is the c :(de :

 

<?php

 

$to = "[email protected]";

$subject = "Hello";

$message = "This is a test message!";

$headers = "FROM: [email protected]";

 

if (mail($to, $subject, $message,$headers)) {

echo "Message sent!";

} else {

echo "Message sending failed.";

}

 

?>

 

 

This is the error message :

 

???Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.my.server.net" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php\email.php on line 8

 

:'(Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php\email.php on line 8

 

Any suggestions on what should be done , and Do i have any ioption of using the Free SMTP server that i Have downloaded.

 

Thanks a Lot!! 8)

Link to comment
https://forums.phpfreaks.com/topic/129447-problem-sending-e-mail-using-php5/
Share on other sites

Okay First Error

???Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.my.server.net" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php\email.php on line 8

 

I assume your mail domain isn't smtp.my.server.net.. But if you installed "Free SMTP Server" (which i have never used before) on the same PC then your localhost is your SMTP Server.. so in the PHP.INI change

SMTP = smtp.my.server.net

to

SMTP = localhost

 

The other errors may be related so lets resolve one at a time..

you may need to restart your PHP server after the change.. but "Free SMTP Server" should be running (do it have a test option?)

 

Last be not least this isn't really a PHP question..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.