I have problem with using PHP mailer class.The problem is when I send email after some time I get this error:
Also, when I put comment on Bcc and Cc part in php mailer code , nothing changes...still got the same spam mail in my inbox. Here is my code for sending emails:
if (mysqli_query($conn, $change)) {
$mail->isSMTP();
$mail->CharSet = 'UTF-8'; // Set mailer to use SMTP
$mail->Host = 'mail.xxx.xxx.xx'; // Specify main and backup SMTP servers
$mail->SMTPAuth = false; // Enable SMTP authentication
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 25; // TCP port to connect to
$mail->setFrom('prigovori@xxx.xxx.xx', 'SOME ADDRESS');
$mail->addAddress($someMail); /// Add a recipient
$mail->addReplyTo('prigovori@xxx.xxx.xx');
//CC and BCC
//$mail->addCC("cc@example.com"); // i put those two lines under comments in order to disable email spam but nothing changes
//$mail->addBCC("bcc@example.com");
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'EMAIL SUBJECT';
$mail->Body = '<h2 style="margin-bottom: 30px;color: black;">Some title</h2>
<div style="height: auto;display:block;margin-bottom: 20px;background-color: white;">
<p style="color: black;">Here is some email text</p>
</div>';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}