Hi guys, I need some urgent help regarding phpmailer script. I have uploaded the class files class.stmp.php and class.phpmailer.php at /usr/local/lib/php/ location but I am getting below error while sending mail through PHP script: Warning: fsockopen() [function.fsockopen]: unable to connect to mail.domain.com:25 in /usr/local/lib/php/class.smtp.php on line 105 Message was not sent Mailer Error: Language string failed to load: connect_host I am able to connect to mail server using port 25 and fsockopen() is also enabled on the server. Did someone face same issue? Regards, Kailash
Do the PHPMailer files not need to be in your web root folder? ie above /www/ ? Are you on a dedicated server or shared hosting?
I have put the class files in /usr/local/lib/php/ (which is added in include path in php.ini). Hence, there is no need to put these class files in the webroot of the domain. Kailash
i haven't used this software but... Warning: fsockopen() [function.fsockopen]: unable to connect to mail.domain.com:25 in /usr/local/lib/php/class.smtp.php on line 105 Message was not sent Code (markup): is telling me you are missing a configuration step, it appears that it's trying to connect to "mail.domain.com". i would recommend you get the examples and find out which line you need to set correctly.
I managed to resolve this error by downgrading Apache version from 2 to 1.3 and PHP version to 4.4.8. I am not sure whether it was Apache problem or PHP. Regards, Kailash