简体   繁体   中英

Send mail with php = spam or bin

Despite having a 10/10 score with mail-test.com, an SPF and valid DKIM , my emails arrive

-in spams with Gmail

-doesn't arrive at all with Hotmail and 1&1

-arrive with no problems with Orange

I don't know which way to look at, maybe it could have something to do with mx ?

Here is my configuration, but first the mail-tester report:

Score: 10/10

-Your server 212.227.XXX.XXX is authentified to use www-data@mydomain.com

-Your server 212.227.XXX.XXX is authentified to use contact@mydomain.com

-You DKIM signature is valid.

-You dont send your emails from your own domain: we cant verify DMARC

-Your server 212.227.XXX.XXX is correctly associated to mydomain.com

-Your hostname mydomain.com is attached to a server

-Your server is not blacklisted

-Reverse DNS shows mydomain.com

DNS parameters :

Server of names 1&1

A 212.227.XXX.XXX

MX mx00.1and1.fr

MX mx01.1and1.fr

MX-record:

Server email 1&1

Php code to send emails :

    <?php 
        ini_set( 'display_errors', 1 );
        error_reporting( E_ALL );
        $headers = "From: contact@mydomain.com\n"; 
        $headers .= "MIME-Version: 1.0\n";
        $headers .= "Reply-To:  <contact@ mydomain.com >\n";
        $to = "reciever@hotmail.fr";
        $subject = "Website subscription";
        $message = "Hi! \n Thanks for subscribing to mydomain.com. \n
        But in the best case I will end up in spams. It's a pitty. ";
        mail($to,$subject,$message,$headers);
        echo "Test email sent";
    ?>

Thanks in advance if you can avoid me new nights of insomnia!

Some of the criteria:

BODY: HTML has a low ratio of text to image area
BODY: Message only has text/html MIME parts 
BODY: HTML has a low ratio of text to image area 
BODY: HTML and text parts are different
Subject is all capitals
BODY: HTML and text parts are different 

Rest are explained in details here: http://blog.mailchimp.com/most-common-spam-filter-triggers/

I also suggest you to use 3rd party APIs to send all important emails as spamming ratio is very low.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM