Compiling email with multiple attachments in PHP

前端 未结 3 1982
暖寄归人
暖寄归人 2021-01-15 00:59

I need to send out an email with multiple image attachments from PHP. I currently have a test set up that uses two hard coded images. I compile the email with al the necessa

相关标签:
3条回答
  • 2021-01-15 01:39

    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.

    0 讨论(0)
  • 2021-01-15 01:43

    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";  
    
    0 讨论(0)
  • 2021-01-15 01:46

    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.

    0 讨论(0)
提交回复
热议问题