daveh33 Posted November 16, 2007 Share Posted November 16, 2007 I have wrote a simple mail script which was working fine - when I moved it to a different server I get the 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 E:\home\project32\sendmessage.php on line 219 I tried to add the below code: - ni_set(smtp, "mail.mydomain.com"); ini_set(smtp_port, 25); //25 is the default But it still displays that error message - can anyone help me please! Link to comment https://forums.phpfreaks.com/topic/77606-solved-mail-failure-to-connect-to-mailserver/ Share on other sites More sharing options...
Daniel0 Posted November 16, 2007 Share Posted November 16, 2007 Use 'smtp' and 'smtp_port' (strings) instead unless you have defined constants named like that which holds the values. Link to comment https://forums.phpfreaks.com/topic/77606-solved-mail-failure-to-connect-to-mailserver/#findComment-392816 Share on other sites More sharing options...
daveh33 Posted November 16, 2007 Author Share Posted November 16, 2007 Sorry I am a newbi! how do I do that? Link to comment https://forums.phpfreaks.com/topic/77606-solved-mail-failure-to-connect-to-mailserver/#findComment-392818 Share on other sites More sharing options...
Daniel0 Posted November 16, 2007 Share Posted November 16, 2007 ini_set('smtp', "mail.mydomain.com"); ini_set('smtp_port', 25); Note that these settings are only relevant in Windows. Link to comment https://forums.phpfreaks.com/topic/77606-solved-mail-failure-to-connect-to-mailserver/#findComment-392821 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.