ellescuba27
Member
- Messages
- 273
- Reaction score
- 3
- Points
- 18
So unfortunately, I need help with PHPMailer again. I have a pretty poor knowledge with PHPMailer or any PHP at all, really. But my problem is I can't connect to SMTP host. I get error 111 when debugging "The connection was refused by the server".
Here is my code:
Now here's a question. Recently I signed up for dot.tk with my subdomain. I set it to forward to my address, so I figured it wouldn't be a problem, but I wonder if that is the cause? Everything seemed to be working before with the exact same code. Also, just this morning, there was an alert about issues with the datacentre, so that could also be the cause. Whatever it is, I hope I can solve it soon, because this is not just emails to myself anymore (I have not reached the 100 mail limit yet, just so you know).
Here is my code:
PHP:
<?php
require_once("phpmailer/class.phpmailer.php");
$error = null;
function smtpmailer($to, $subject, $message, $winerror, $failerror) {
global $error;
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.theeducator.elementfx.com";
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->Port = 25;
$mail->Username = "(username blocked)";
$mail->Password = "(password blocked)";
$mail->SetFrom("(email blocked)", "The Educator");
$mail->AddReplyTo("(email blocked)", "The Educator");
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AddAddress($to, "Our Friend");
if($mail->Send()) {
$error = false;
echo $winerror;
} else {
$error = true;
echo $failerror;
}
}
?>
Now here's a question. Recently I signed up for dot.tk with my subdomain. I set it to forward to my address, so I figured it wouldn't be a problem, but I wonder if that is the cause? Everything seemed to be working before with the exact same code. Also, just this morning, there was an alert about issues with the datacentre, so that could also be the cause. Whatever it is, I hope I can solve it soon, because this is not just emails to myself anymore (I have not reached the 100 mail limit yet, just so you know).