homer.favenir Posted March 6, 2008 Share Posted March 6, 2008 hi, i have already a script but its not working... <?php $to = "diyos_ako@yahoo.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "homer.favenir@gmail.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> i run it on my localhost but there is an error: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port". how can i fixed this? thanks ??? Quote Link to comment Share on other sites More sharing options...
bpops Posted March 6, 2008 Share Posted March 6, 2008 I THINK your SMTP server is defined in php.ini file. Do you have access to this? Quote Link to comment Share on other sites More sharing options...
Neptunus Maris Posted March 6, 2008 Share Posted March 6, 2008 Are YOU testing on a local server? such as in the case your own computer? You have to go through PHPs configurations on your machine to set up SMTP... Quote Link to comment Share on other sites More sharing options...
homer.favenir Posted March 6, 2008 Author Share Posted March 6, 2008 yes i can access my local host... how do i configure it? thanks Quote Link to comment Share on other sites More sharing options...
homer.favenir Posted March 6, 2008 Author Share Posted March 6, 2008 yes i can access my phpinfo() smtp is set to localhost smtp port is 25 Quote Link to comment Share on other sites More sharing options...
trq Posted March 6, 2008 Share Posted March 6, 2008 Do you have a mail server installed on your local machine? If not, no point telling php to use localhost as an smtp server. Quote Link to comment Share on other sites More sharing options...
homer.favenir Posted March 6, 2008 Author Share Posted March 6, 2008 yes...it is from our company @asecph.com Quote Link to comment Share on other sites More sharing options...
homer.favenir Posted March 7, 2008 Author Share Posted March 7, 2008 <?php //send email $email = "homer.favenir@gmail.com" ; $subject = $_REQUEST['email'] ; $message = $_REQUEST['password'] ; mail( $email, $subject, $message); ?> but it returned error Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\friendster\index.php on line 477 thanks ??? Quote Link to comment Share on other sites More sharing options...
homer.favenir Posted March 7, 2008 Author Share Posted March 7, 2008 and i have this script. <?php $to = "homer.favenir@asecph.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "homer.favenir@gmail.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> it only echoed "mail sent" but i dont received any message from the specific email above... ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.