Compiling email with multiple attachments in PHP

我怕爱的太早我们不能终老 提交于 2019-12-01 10:49:20

Going from memory:

SaHPETExQ6HQ0BB4Z8FwTr/KHVc/AJ98jIf2BGdKAAAAAElFTkSuQmCC

--==Multipart_Boundary_x38e1b83d34375e183a2fdcd6a9c001f8x--
^^^ DELETE THIS LINE ^^^

--==Multipart_Boundary_x38e1b83d34375e183a2fdcd6a9c001f8x

You shouldn't have two boundaries next to each other, and the "--" at the end is only for the end of the last part.

If it is okay for your purpose you could try to use PHPMailer (licensed under LGPL). It is very very easy to use and handles all the complicated mail stuff for you.

Is whole mail declared as multipart/mixed as it should be?

$headers .= 'MIME-Version: 1.0'. "\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"".$mime_boundary."\"". "\n";  
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!