0
It had this function running on the localhost perfectly, and in all tests it sent the emails correctly but after I put it on my server it no longer sends the emails and gives the error "500 Internal Server error" does anyone know what the problem is? thank you
function SendMail($subject, $message, $to, $toName){
$mail = new PHPMailer();
// Servidor
$mail->isSMTP();
$mail->Host = 'xxxxxxxxx';
$mail->SMTPAuth = true;
$mail->Username = 'xxxxxxx';
$mail->Password = 'xxxxxx';
$mail->Port = xxxx;
$mail->SMTPSecure = false;
// Remetente
$mail->From = 'xxxxx';
$mail->FromName = 'xxxx';
// Destino
$mail->addAddress($to, $toName);
// Dados da Messagem
$mail->isHTML(true);
$mail->CharSet = 'utf-8';
$mail->WordWrap = 70;
// Mensagem
$mail->Subject = $subject;
$mail->Body = $message;
$mail->Altbody = strip_tags($message);
return $mail->Send();
}
Note: xxx= are my personal data that I did not put here but are correct on my server.
Do you know if sending emails is enabled on the remote server? You have access to the application logs?
– Rodrigo Rigotti
yes are enabled, it’s all right, before I used the same settings of sending email on my remote server to the localhost and the emails were sent, after I uploaded the files to the server no longer gives.
– Aron Brivio
What changed from before to after?
– Rodrigo Rigotti
in relation to the server code or response? The code is the same because my remote server’s email sending settings are the same
– Aron Brivio
Add these two lines at the beginning of the file that calls its function,
ini_set('display_errors', true);error_reporting(E_ALL);
if you have any error it will hablitar the display. Put tbm the phpmailer debug,$mail->SMTPDebug = 1;
– rray
did not modify anything... the page loads about 30 seconds and then displays the message "Internal Server Error"
– Aron Brivio
Now it returned error "SMTP ERROR: Failed to connect to server: Connection timed out (110) 2015-01-08 17:17:12 SMTP connect() failed."
– Aron Brivio