Jump to content

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 = user@somesite.net

 

This is the c :(de :

 

<?php

 

$to = "avinash_singh_as@yahoo.com";

$subject = "Hello";

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

$headers = "FROM: user@somesite.net";

 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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