I am a newbie to php and local server testing environment. I have installed Wampserver without issue. I have developed some php scripts for sites and they work pretty well. Now, I am trying to send an email to a user with a code for registration much like is done on this site. However, to my chagrin and I guess embarrassment, I cannot get any of the mail server (free) working. I have tried postcast, send mail, etc. and am having no luck. Is there anyone who can tell me where I might get a good tutorial on how to get a server working or how to change php.ini to utilize my own isp. Thanks....apologize for my ignorance, but would like some advice.
Thanks.
mail server for local host
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: mail server for local host
Google search results
Take a look at some of these, hth.
Take a look at some of these, hth.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: mail server for local host
I have tried many of these and they all give me the same message about smtp, port error, etc......I have even reinstalled wampserver2 thinking I may have don something wrong.....I read the forums and still get errors. Here is my current config....
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = rlv302@att.net
<?php
$to = "gypsy571@yahoo.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "rlv302@att.net";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Error message received:
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\cccga\testmail.php on line 10
Mail Sent. >
ANy help greatly appreciated
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = rlv302@att.net
<?php
$to = "gypsy571@yahoo.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "rlv302@att.net";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Error message received:
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\cccga\testmail.php on line 10
Mail Sent. >
ANy help greatly appreciated
Re: mail server for local host
Do you have a mail server running locally? For testing purposes, you could always use your ISP's SMTP server, or gmail's or whatever.bob302 wrote:Here is my current config....
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
Re: mail server for local host
I do not have a mail server running locally. Tried to intall many of the free ones and was never able to send mail. I am a newbie in that area and could not find one with a tut or instructions. I have tried to use my own ISP as indicated above and received the above errors. Are you aware of a tutorial or how to reconfig ini and what code to include in the script? Thanks so much for looking.
Bob
Bob
Re: mail server for local host
I don't see any examples above that use your ISP, only the one attempting to use a locally installed mail server. Have you tried setting SMTP = smtp.yourisp.com? What errors did that produce? Did you try changing the SMTP port to 587? Any luck with that?bob302 wrote:I have tried to use my own ISP as indicated above and received the above errors.
Re: mail server for local host
tried this.......
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.att.yahoo.com
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = rlv302@att.net
<?php
$to = "gypsy571@yahoo.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "rlv302@att.net";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.att.yahoo.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\cccga\testmail.php on line 10
Mail Sent. >
will change port and try again
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.att.yahoo.com
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = rlv302@att.net
<?php
$to = "gypsy571@yahoo.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "rlv302@att.net";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.att.yahoo.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\cccga\testmail.php on line 10
Mail Sent. >
will change port and try again
Re: mail server for local host
interesting simply changed the port to 587 in ini - stopped and restarted wamp2 and I get the same error message indicating port 25.....