douyou3619 2017-02-06 08:38
浏览 27

带有BCc和Cc的PHP邮件程序

I have problem with using PHP mailer class.The problem is when I send email after some time I get this error:
enter image description here

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';
    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
    • ¥15 安装svn网络有问题怎么办