By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,278 Members | 1,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,278 IT Pros & Developers. It's quick & easy.

having an error that is giving me problems when using mail function in php

P: 7
Warning: mail() [function.mail]: Failed to connect to mailserver at "" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\selection\Untitled-6.php on line 16
Mail Sent.
Sep 4 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 1,584
is that IP address a valid mail (SMTP) server?

If so, can you telnet to it on port 25?

How: open command line type telnet <ipaddress> 25

post the response here.
Sep 4 '08 #2

P: 7
the SMTP is valid because it is the one we use to access our local mail on our

now for port 25 when i did the telnet thingy on port 25 like telnet 25
it is giving me this error:
could not open connection to the host,on port 23: connection failed
Sep 5 '08 #3

P: 3
Expand|Select|Wrap|Line Numbers
  1. $from ="<!--EMAIL ADDRESS-->";
  2. $headers  = "From:" .$from. "\r\n";
  3. $headers .= "MIME-Version: 1.0\r\n";
  4. $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
  6. mail($to,$subject,$txt,$headers);
  7. //$txt will contain the text want to sent in html format.
Jul 30 '14 #4

Post your reply

Sign in to post your reply or Sign up for a free account.