Problem with messages sent by PHPMailer fall in SPAM in hotmail

3

We use a PHPMailer script on a server with Centos 7.0 and Postfix to send emails. Our server has an Open DKIM key and has an SPF record.

When we send messages one by one they arrive without problems, but when using the script they always go to SPAM, unless each user adds each account as a secure sender.

<?php

include_once('fk_clases/class.phpmailer.php');//PHPMailer

$Subject = "Mensaje sobre llave DKIM y PHP";
$BodyCorreo = "Esta es una prueba para verificar la entrega de un correo con llave OpenDKIM";

$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->Helo = "midominio.com";
$mail->SMTPAuth         = true;
$mail->Port             = 587; //puerto seguro
$mail->SMTPSecure       = 'tls'; //Conexion cifrada TLS
$mail->Host             = "mail.midominio.com";
$mail->Username         = '[email protected]';
$mail->Password         = 'mipassword';
$mail->AddReplyTo('[email protected]','Dennis');
$mail->From             = '[email protected]';
$mail->FromName         = 'Dennis';
$mail->AddAddress('[email protected]');
$mail->Subject          = $Subject;
$mail->DKIM_domain = 'midominio.com';
$mail->DKIM_private = 'ruta de la llave';
$mail->DKIM_selector = 'default';

$file_to_attach = '/root/cola.log';

$mail->AddAttachment('/root/cola.log', 'cola.log' );
$mail->Send();
    
asked by Dennis Isaias Cervantes Nuñez 09.05.2017 в 17:40
source

2 answers

1

Check that you have the SPF properly configured, that may be one of the reasons why the email you are sending spam.

Here I give you an SPF generator .

You also have to see the reputation of the IP from which you are sending the email, so that even if you have the SPF properly configured, if the IP of the server from which you send it is in some blacklist, when passing through that server, the reputation falls.

A couple of places where you can look:

link

link

link

Similarly, by sending an email to this website, you can see the reputation of the email and the chances of it falling into spam. It can help you improve your reputation:

link

About the mail configuration that I see in the script, I understand that you connect to the SMTP server correctly because you say that the mail arrives. Well, when the mail reaches the destination account, what reputation does it have?

Can you put the source code of the email?

    
answered by 16.05.2017 в 11:49
0

Your emails go to spam because it does not have SMTP authentication but in your code I see that if it is .. if you are running it through a host it verifies that hosting dodne is hosted has a good reputation because the ip is cataloged as massive and they begin to read the mail to spam.

If you persist with this problem, use this library link

And if the problem is not solved it is because of the reputation of the host.

    
answered by 09.05.2017 в 18:24