L
L
LazariusPaskalius2019-08-04 13:28:38
Yandex
LazariusPaskalius, 2019-08-04 13:28:38

When sending data from the form to the mail, the mailbox is blocked for spam, how to fix it?

I created a form on the site, the data from it should come to mail A and be sent from mail B. Mail B is blocked after the first letter from the site for spam ( Error: authentication failed: Your message looks like spam.). Is there any way to bypass this blocking?

<?php 




require_once('phpmailer/PHPMailerAutoload.php');
$mail = new PHPMailer;
$mail->CharSet = 'utf-8';

$name = $_POST['user_name'];
$phone = $_POST['user_phone'];
$message = $_POST['user_message'];

$mail->SMTPDebug = 2;                               // Enable verbose debug output

$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtp.yandex.ru';  																							// Specify main and backup SMTP servers
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = '[email protected]'; // Ваш логин от почты с которой будут отправляться письма
$mail->Password = 'password'; // Ваш пароль от почты с которой будут отправляться письма
$mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to / этот порт может отличаться у других провайдеров

$mail->setFrom('[email protected]'); // от кого будет уходить письмо
$mail->addAddress('[email protected]');     // Кому будет уходить письмо 

$mail->isHTML(true);                                  // Set email format to HTML

$mail->Subject = 'Заявка  '.$name;
$mail->Body    = '' .$name . ' оставил заявку, его телефон ' .$phone. '<br>Заявка пользователя: ' .$message;
$mail->AltBody = '';


if(!$mail->send()) {
    echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    header('location: allisworking.html');
}

?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanes, 2019-08-04
@Sanes

Set up mail server and DNS.
If Yandex, then he does not like repetitive letters. By content and sender.
https://www.mail-tester.com/

T
tempick, 2019-08-05
@tempick

Most likely, the IP from which the letters are sent was blacklisted by the mail service. Try to use a proxy, buy a dedicated IP or unsubscribe in support of the mail service

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question