简体   繁体   中英

PHP sending mail and not receiving on gmail

I have a php script that sends emails. It works fine on Yahoo or other personal server, but on gmail, I don`t receive anything. Neither in Spam folder.

What headers should I add to work?

I`m using mail() function.

$clientSubject = "Rays : programare confirmata!";
$clientMessage = "Buna " . $clientName . ", am inregistrat programarea ta. \n Te asteptam la Rays!";
$clientHeaders = 'MIME-Version: 1.0' . "\n" .
                     'From: "Rays" <private>' . "\n" . 
                     'Reply-To: private' . "\n" . 
                     'X-Mailer: PHP/' . phpversion(). "\n". 
                     'Content-type: text/html; charset=iso-8859-1' . "\n"; 

    mail($emailClient, $clientSubject, $clientMessage, $clientHeaders);

This is the error I`m getting:

 SMTP error from remote mail server after end of data:
    host alt1.gmail-smtp-in.l.google.com [173.194.71.27]:
    550-5.7.1 [93.114.40.228      12] Our system has detected that this message is
    550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail,
    550-5.7.1 this message has been blocked. Please visit
    550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for
    550 5.7.1 more information. dj3si2836476lac.55 - gsmtp

------ This is a copy of the message, including all the headers. ------

Return-path: <@server.host28.net>
Received: from rays by server.host28.net with local (Exim 4.82)
    (envelope-from <@server.host28.net>)
    id 1X9fy5-0002AO-Sz
    for private@gmail.com; Tue, 22 Jul 2014 22:43:21 +0300
To: private@gmail.com
Subject: Rays : programare confirmata!
X-PHP-Script: private/scheduler/checkForNewResponses.php for 92.83.242.133
From: "Rays" <private>
Reply-To: private
X-Mailer: PHP/5.3.28
Content-type: text/html; charset=iso-8859-1
Message-Id: <E1X9fy5-0002AO-Sz@server.host28.net>
Date: Tue, 22 Jul 2014 22:43:21 +0300

Short answer:
Gmail has blocked your server ip !

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