В общем mail.ru и yandex.ru отправляют в спам... Google, всё ок.
function SendMail ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $to, $from, $subject, $body, $name) {
$SmtpUser= base64_encode($SmtpUser);
#Пароль авторизации на сервера SMTP
$SmtpPass= base64_encode($SmtpPass);
if ($SMTPIN = fsockopen ($SmtpServer, $SmtpPort, $errno, $errstr, 3)) {
var_dump($errno);
var_dump($errstr);
fputs ($SMTPIN, "EHLO ".$SmtpServer."\r\n");
$talk["hello"] = fgets ( $SMTPIN, 4096 );
fputs($SMTPIN, "AUTH LOGIN\r\n");
$talk["login"]=fgets($SMTPIN,4096);
fputs($SMTPIN, $SmtpUser."\r\n");
$talk["user"]=fgets($SMTPIN,4096);
fputs($SMTPIN, $SmtpPass."\r\n");
$talk["pass"]=fgets($SMTPIN,4096);
fputs ($SMTPIN, "MAIL FROM: <".$from.">\r\n");
$talk["from"] = fgets ( $SMTPIN, 4096 );
fputs ($SMTPIN, "RCPT TO: <".$to.">\r\n");
$talk["to"] = fgets ($SMTPIN, 4096);
fputs($SMTPIN, "DATA\r\n");
$talk["data"]=fgets( $SMTPIN,4096 );
fputs($SMTPIN, "TO: <".$to.">\r\nFROM: <".$name.">\r\nSUBJECT: ".$subject."\r\n\r\n\r\n".$body."\r\n.\r\n");
$talk["send"]=fgets($SMTPIN,4096);
fputs ($SMTPIN, "QUIT\r\n");
$talk["quit"]=fgets($SMTPIN,4096);
fclose($SMTPIN);
} else {
return false;
}
var_dump ($talk);
return $talk;
mail test:
R_DKIM_NA
Спам-балл: 1.5
DKIM record dns not found
RCVD_NO_TLS_LAST
Спам-балл: 0.1
Last hop did not use encrypted transports
BROKEN_CONTENT_TYPE
Спам-балл: 1.5
Message has part with broken content type
SUBJECT_NEEDS_ENCODING
Спам-балл: 1
Subject needs encoding
MISSING_MIME_VERSION
Спам-балл: 2
MIME-Version header is missing
R_MISSING_CHARSET
Спам-балл: 2.5
Charset is missing in a message