Jump to content

problem sending email


niche
 Share

Recommended Posts

This script:

<?php$to = "me@neb.rr.com";$subject = "Test mail";$message = "Hello! This is a simple email message.";$from = "me@neb.rr.com";$headers = "From: $from";mail($to,$subject,$message,$headers);echo "Mail Sent.";?>

produces this error: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\test13.php on line 7Mail Sent.How do I check for the correct port setting? I found the place in the php.ini file that sets the port I just need to know how to decide what to change it to.

Edited by niche
Link to comment
Share on other sites

SMTP servers are not part of the traditional *AMP stack. You don't need to install a local SMTP server, however – you can use a publicly available one such as Google's (smtp.gmail.com).

Link to comment
Share on other sites

Thanks for your help justsomeguy and Synook. I set the stmp setting in my ini file to my out going mail server and it works.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...