The problem is little strange.
If I use 'localhost' as mail server then SUCCESS, but if I use 'mail.mydomain.net' it fails.
Code: Select all
try {
$mailer = new Swift(new Swift_Connection_SMTP( 'mail.mydomain.net', SWIFT_DEFAULT_PORT, SWIFT_OPEN));
} catch (Swift_ConnectionException $e) {
print_r($e->getMessage());
}PHPMailer says -NOT CONNECTED !!
Can you please suggest me how can I solve this problem ?Warning: fsockopen() [function.fsockopen]: unable to connect to mail.gigahertz.net.in:25 (Connection timed out) in /home/gigahert/public_html/includes/phpmailer/class.smtp.php on line 105
SMTP -> ERROR: Failed to connect to server: Connection timed out (110) Error:SMTP Error: Could not connect to SMTP host.
I want to allow both 'localhost' and 'mail.mydomain.net' for sending mails.
NOTE:
System: Linux
Server: Apache
Script: PHP5
Web-Server and Mail-Server are in same PC.