I have a problem sending email using a server I created in a contracted data center.
Sending e-mail works locally normally, although SMTP is in a well-known hosting company (I've seen that they allow 20 emails per day for international IP). I've tried using other email services and it always works locally.
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = $host;
$mail->SMTPAuth = true;
$mail->Username = $user;
$mail->Password = $password;
$mail->Port = 587;
$mail->SMTPDebug = 2;
//$mail->SMTPSecure = 'tls';
$mail->From = $from_mail;
$mail->FromName = $from_name;
$mail->addAddress($to);
$mail->WordWrap = 50;
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
Does anyone have any idea what it can be?
The return whenever I try to send on the remote server is
2014-01-19 17:04:52 SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect () failed. Message could not be sent.Mailer Error: SMTP connect () failed.