Login    Forum    Search    FAQ   Blog

Board index » Server Side Development » PHP




 Page 1 of 1 [ 3 posts ] 



Author Message
 Post subject: Faild 2 connect 2 mailserver
 Post Posted: Mon Nov 16, 2009 11:44 am 
Offline

Joined: Sat Feb 21, 2009 1:03 pm
Posts: 47
Hi people !!!!,

Presetly m usin a very simple PHP mailer nd it failed to connect to mail server.

This is the code:

Code:
#    $toEmail = "ramwy@myemail.com";

#         $subject = "Your access details for Learning Managment System (LMS)";
#         $message = "Dear Colleague,<br><br>";
#         $toEmail = "ramwy@myemail.com";
#         $fromemailid="ramwy@myemail.com";
#         $fromemail = "ramwy Email <".$fromemailid.">"; //\r\n optional headerfields
#   
#         $headers = "From: $fromemailid\n";
#         mail($toEmail,$subject,$message,$headers);  // LINE 48 the error line



This is the error I'm getting with I run the code:


Code:
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:\_webserver\emailer\test_emailer.php on line 48



What should I change on ini_set() to make the email working? pls help :banghead:


Top 
 Post subject: Re: Faild 2 connect 2 mailserver
 Post Posted: Mon Nov 16, 2009 11:46 am 
Offline

Joined: Sat Feb 21, 2009 1:08 pm
Posts: 549
hi, not so sure what that message means but some servers dont support SMTP (for sending of form from your website to your account)

Or the mail service on the server is wrongly configured

QQ--I'm on WAMP

My php.ini is as below:


Code:

# [mail function]
# ; For Win32 only.
# SMTP = localhost
# smtp_port = 25

# ; For Win32 only.
# ;sendmail_from = me@example.com

# ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
# ;sendmail_path =

# ; Force the addition of the specified parameters to be passed as extra parameters
# ; to the sendmail binary. These parameters will always replace the value of
# ; the 5th parameter to mail(), even in safe mode.
# ;mail.force_extra_parameters =


Its the default php.ini settings, I've not changed it. Is the above config wrong?

any suggestions? to over come this issue and be able to send out emails?


Top 
 Post subject: Re: Faild 2 connect 2 mailserver
 Post Posted: Mon Nov 16, 2009 11:47 am 
Offline

Joined: Sat Feb 21, 2009 1:03 pm
Posts: 47
finally fixed the problem, added in the php page I specified the different SMTP server and the port.

Initially the port was blocked. And I had to open the port to make the Apache talk with mailserver

Code:
#
#    ini_set("SMTP","x.x.x.x");
#    ini_set("smtp_port","25");


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 3 posts ] 




Board index » Server Side Development » PHP


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron