• 技术文章 >php教程 >php手册

    php 发送带附件邮件的实现代码

    2016-06-13 09:43:54原创356

    1,emailclass.php

           = "--==================_846811060==_"  CMailFile(,,,,,, = "application/octet-stream", = ->subject = ->addr_to = ->smtp_headers = ->write_smtpheaders(->text_body = ->write_body(->text_encoded = ->attach_file(,,,->mime_headers = ->write_mimeheaders(,  attach_file(,,, = ->encode_file( ()  =  = "--" . ->mime_boundary . "\n" =  . "Content-type: " .  . "; name=\"\";\n" =  . "Content-Transfer-Encoding: base64\n" =  . "Content-disposition: attachment; filename=\"\"\n\n" =  .  . "\n" =  . "--" . ->mime_boundary . "--" . "\n"  encode_file( (( = (, "r" = (, ( = (((  = ->smtp_headers . -> = ->text_body . ->(->addr_to,->subject,,.jbxue. write_body( = "--" . ->mime_boundary . "\n" =  . "Content-Type: text/plain; charset=\"us-ascii\"\n\n" =  .  . "\n"  write_mimeheaders(,  ()  =  = "MIME-version: 1.0\n" =  . "Content-type: multipart/mixed; " =  . "boundary=\"->mime_boundary\"\n" =  . "Content-transfer-encoding: 7BIT\n" =  . "X-attachments: ;\n\n"  write_smtpheaders( = "From: \n" =  . "Reply-To: \n" =  . "X-Mailer: PHP3\n" =  . "X-Sender: \n" sendfile();
    
    $subject -- 主题 
    $sendto -- 收信人地址 
    $replyto -- 回复地址 
    $message -- 信件内容 
    $filename -- 附件文件名 
    $downfilename -- 下載的文件名 
    $mimetype -- mime类型 
     
    ?>

    ('emailclass.php'
     = "test send email"
     = 'abc@163.com'
     = 'cdf@163.com'
     = "test send email content"
     = 'test.jpg'
     = "image/jpeg" =  CMailFile(,,,,,,->?>

    您可能感兴趣的文章:
    php 发送带附件邮件的类
    php socket使用smtp发送带附件的邮件
    PHPMailer发送带附件邮件的例子

    php入门到就业线上直播课:查看学习

    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

    前端(VUE)零基础到就业课程:点击学习

    清晰的学习路线+老师随时辅导答疑

    自己动手写 PHP MVC 框架:点击学习

    快速了解MVC架构、了解框架底层运行原理

    专题推荐:aspnet 软件编程
    上一篇:php获取网页标题和内容函数 下一篇:自己动手写 PHP MVC 框架(40节精讲/巨细/新人进阶必看)

    相关文章推荐

    • ❤️‍🔥共22门课程,总价3725元,会员免费学• ❤️‍🔥接口自动化测试不想写代码?• php操作mysqli(示例代码)• php+ajax导入大数据时产生的问题处理• 最常用的8款 PHP 调试工具,你用过吗?• php 复杂生成验证码图片
    1/1

    PHP中文网