doupiai5597 2009-09-24 03:07
浏览 46

我需要自动将文件附加到出站电子邮件...帮助

I have one form (input.html) that's completed by people working in five different divisions of this business. When the form is submitted it posts to output.php.

Output.php does a number of things: First it displays all of the input information to the screen as a completed form. (Just to show them their completed document).

It has also created a file called unique_file.html based on two of the input fields in input.html.

Next, output.php has sent an email to one of five email groups, based upon another input field selected in input.html.

Finally (for now), I need the unique_file.html to be an attachment to the email. That is my problem.

I have found scripts for uploading files, I have found many tutorials about uploading files, but I just want to attach the unique_file.html to my outgoing email and I am not seeing how that is done.

Can someone point me in the right direction as to where to start? I am certainly missing the boat on this one and I have probably seen it and not realized it.

  • 写回答

2条回答 默认 最新

  • douchun5969 2009-09-24 03:13
    关注

    If you can use the Zend_Framework you can easily attach file to an email i.e.

    $mail = new Zend_Mail();
    
    $at = new Zend_Mime_Part($myImage);
    $at->type        = 'image/gif';
    $at->disposition = Zend_Mime::DISPOSITION_INLINE;
    $at->encoding    = Zend_Mime::ENCODING_8BIT;
    $at->filename    = 'test.gif';
    
    $mail->addAttachment($at);
    
    $mail->send();
    

    see the documentation, You should be able to attach a file also by using Mail_Mime pear package and the normal mail function.

    But I think the solution using the Zend framework is much more straight forward.

    Cheers.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度