hello friends i am young in learning php, and now i face a problem which i can't solve for a week. I want to send a email through using php. But the IE display this message: Warning: mail(): Failed to connect to mailserver at "netvigator.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\appserv\www\revealtech\survey\sendemail.php on line 15 Warning: mail(): Failed to connect to mailserver at "netvigator.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\appserv\www\revealtech\survey\sendemail.php on line 15 here is the code in php.ini: [mail function] ; For Win32 only. SMTP = netvigator.com ; For Win32 only. sendmail_from = honmen@netvigator.com here is the code in my php file: $to = "pw_group14@yahoo.com.hk"; $header = "From: honmen@netvigator.com"; $subject = "testing mail"; $message = "no reply pls"; mail($to, $subject, $message, $header); ini_set("SMTP","netvigator.com"); ini_set("SMTP_PORT", 25); ini_set("sendmail_from","honmen@netvigator.com"); help me please, thanks for all help thanks for all help
Is there a SMTP running on port 25 available on that host from your IP? Send the emails thru localhost instead? Install sendmail or something...
ok. Why are you using sendmail anyway!? just simply use the php mail() function. Try this: <? $ToEmail = "pw_group14@yahoo.com.hk"; $ToSubject = "testing mail"; $EmailBody = "hi! It worked!!"; mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$FirstName." <".$Email.">"); ?> PHP: Paste this script into a file named 'mail.php' for example and surf to it using your browser. You should receive an email if your mail() function is working on your server. Offcourse, altermatly you will need to collect the variables from a submitted form .... but you have this form already probably...just make sure the variables match. Hope this helps.
Keep in mind that if you don't include headers when using the mail function, your email can more easily be marked as spam.
are you sure it is only netvigator.com? maybe youre missing SMTP.netvigator.com or mail.netvigator.com this would be okay if your SMTP is just open relay. but if it is Login Authenticated that is another problem. you need a script that will accept SMTP hostname/port/ username/ password.