Forum Moderators: coopster

Message Too Old, No Replies

PHPMailer - issues connecting to remote server

         

alexh

9:19 am on Dec 11, 2003 (gmt 0)

10+ Year Member



I have been trying to get PHPMailer to connect out to a remote host without any success. Following the online tutorial I set up the following code:

$mail = new PHPMailer();
$mail -> isSMTP();
$mail -> HOST = "my ip";

However it keeps telling me it can't make the connection, stating the port as a possible problem. It is using the standard port 25, which is the correct port for my mail server. I have trawled through the online help and posted a message to the PHPMailer discussion group without any success.

Any thoughts?

Thanks.

percentages

10:06 am on Dec 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Try something like this:

require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.mydomain.com";
$mail->SMTPAuth = true;
$mail->Username = "username";
$mail->Password = "password";
$mail->From = "me@mydomain.com";
$mail->FromName = "My Real Name";
$mail->AddAddress($recipient, $name);

alexh

10:47 am on Dec 11, 2003 (gmt 0)

10+ Year Member



Thanks for your help. I just tried your suggestion but am getting the same error:

Warning: fsockopen(): unable to connect to localhost:25 in /Users/admin/Sites/lib/phpmailer/class.smtp.php on line 105
message was not sentMailer Error: Language string failed to load: connect_host

Why is it trying to connect to localhost when I have set the HOST?