doumaoao0182 2013-04-09 12:52
浏览 29

在zend框架中附件的垃圾邮件

I am trying to send email with zip file attachment using zend framework. but always i send it go to junk directory of my email.

Here is attached code i used.

I don't know what is the problem please help me to find this. Thanks a lot.

    $mail = new Zend_Mail();
    $mail->setType(Zend_Mime::MULTIPART_RELATED);
    $mail->setBodyHtml($email_body);
    $mail->setFrom('admin@website.com', 'Stephen Nolan');
    $mail->addTo($_POST['email'], 'Kamalifestyle Client');
    $mail->setSubject('Thanks From Kamalifestyle, See Attachment');

    $attachment = $mail->createAttachment(file_get_contents($currentFile));
    $attachment->type = 'zip';        
    $attachment->filename = "completebook.zip";

    if ($mail->send()) {
        unlink($currentFile);
        echo 'Message Sent';
        ?>

    <?php
    } else {
        echo 'Error Sending ';
    }
  • 写回答

1条回答 默认 最新

  • dongxie3681 2013-04-09 12:58
    关注

    $attachment->type should be the MIME type of the attachment, not the file name extension.

    Other reasons might exists why the e-mail ends up in your junk directory. Consult the manual of the software that puts the mail into the junk directory (i.e. either the mail server or the your mail user agent). For example if you IMAP server uses sieve to move messages into the junk directory based on headers added by Spam Assassin, you might want to read Spam Assassin Wiki: False Positives.

    评论

报告相同问题?

悬赏问题

  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题