使用PHP编译具有多个附件的电子邮件

Luk*_*uke 2 php email attachment

我需要发送一封包含PHP多个图像附件的电子邮件.我目前有一个使用两个硬编码图像的测试设置.我用必要的标题编译电子邮件并发送出去.但是,当我收到它时,它只显示第一个图像作为附件.第二个图像似乎被忽略(使用Groupwise和Gmail进行测试).

当我查看我的电子邮件的来源时,以下是我在服务器生成的标题之后看到的内容.显然两个附件(图像)都在那里,但只有第一个作为附件出现.

任何帮助将不胜感激.

This is a multi-part message in MIME format.

--==Multipart_Boundary_x38e1b83d34375e183a2fdcd6a9c001f8x
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

my message text

--==Multipart_Boundary_x38e1b83d34375e183a2fdcd6a9c001f8x
Content-Type: image/gif;
 name="image1.gif"
Content-Disposition: attachment;
 filename="image1.gif"
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAABEAAAAMCAIAAAALR8HoAAABgElEQVQoFZWQzSuEURTG7z3n3Pt+

*[-- snip --]*

SaHPETExQ6HQ0BB4Z8FwTr/KHVc/AJ98jIf2BGdKAAAAAElFTkSuQmCC

--==Multipart_Boundary_x38e1b83d34375e183a2fdcd6a9c001f8x--

--==Multipart_Boundary_x38e1b83d34375e183a2fdcd6a9c001f8x
Content-Type: image/gif;
 name="image2.gif"
Content-Disposition: attachment;
 filename="image2.gif"
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAKMAAAAyCAIAAAC/NPwxAAAAA3NCSVQICAjb4U/gAAAACXBIWXMA

*[-- snip --]*

yh4+kv39P/vticlfC0Muodov+5posktKGGb7/2pscsAoKykp2W8fTH4Exv1tEEbD3NNGwbi/y8do
mNnbKPwf2Oju7uv54J4AAAAASUVORK5CYII=

--==Multipart_Boundary_x38e1b83d34375e183a2fdcd6a9c001f8x--
Run Code Online (Sandbox Code Playgroud)

Gre*_*reg 7

从记忆中走出来:

SaHPETExQ6HQ0BB4Z8FwTr/KHVc/AJ98jIf2BGdKAAAAAElFTkSuQmCC

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

--==Multipart_Boundary_x38e1b83d34375e183a2fdcd6a9c001f8x
Run Code Online (Sandbox Code Playgroud)

你不应该有两个彼此相邻的边界,而末尾的" - "仅用于最后一部分的末尾.