d.shankar Posted October 23, 2007 Share Posted October 23, 2007 My php code contains a mail function which sends mail with predefined hard coded values. The problem is it works in my organization and when i run it in home is get this error Failed to connect to mailserver at "mail.hackerresist.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() Please note that the code works in my organization but not in my home !!! Link to comment https://forums.phpfreaks.com/topic/74470-mail-function-behaves-differently/ Share on other sites More sharing options...
otuatail Posted October 23, 2007 Share Posted October 23, 2007 ini_set("sendmail_from", "[email protected]"); $success = mail($to,$subject, $message, $headers); // $success dosn't matter Try this format Desmond. Link to comment https://forums.phpfreaks.com/topic/74470-mail-function-behaves-differently/#findComment-376304 Share on other sites More sharing options...
d.shankar Posted October 23, 2007 Author Share Posted October 23, 2007 $headers ? I dont make use of headers desmond. Shall i ignore it ? Link to comment https://forums.phpfreaks.com/topic/74470-mail-function-behaves-differently/#findComment-376309 Share on other sites More sharing options...
otuatail Posted October 23, 2007 Share Posted October 23, 2007 No The header is is the last part of the emial, you just did it diffrent. In my example above $headers is the from part as in ... $headers = "Billy <[email protected]>\r\n" Link to comment https://forums.phpfreaks.com/topic/74470-mail-function-behaves-differently/#findComment-376314 Share on other sites More sharing options...
d.shankar Posted October 23, 2007 Author Share Posted October 23, 2007 Ddnt work out dude ! My organization is behind proxy , but my home system is not behind any proxies. Any idea >> Link to comment https://forums.phpfreaks.com/topic/74470-mail-function-behaves-differently/#findComment-376321 Share on other sites More sharing options...
otuatail Posted October 23, 2007 Share Posted October 23, 2007 Sorry. That could be a killer. You could talk to other groups about this issue, but if you have tried the ini_set("sendmail_from", "[email protected]"); and have added the \r\n then these are the only known issues. Desmond. Link to comment https://forums.phpfreaks.com/topic/74470-mail-function-behaves-differently/#findComment-376324 Share on other sites More sharing options...
d.shankar Posted October 24, 2007 Author Share Posted October 24, 2007 Is it possible to set like this ? ini_set("sendmail_from", "The Advertising Council <[email protected]>"); Link to comment https://forums.phpfreaks.com/topic/74470-mail-function-behaves-differently/#findComment-376878 Share on other sites More sharing options...
otuatail Posted October 24, 2007 Share Posted October 24, 2007 I don't know about that. I was handed ini_set by my web host. You need to get the format for the function. Desmond Link to comment https://forums.phpfreaks.com/topic/74470-mail-function-behaves-differently/#findComment-376915 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.