how to send email with graphic via php

前端 未结 4 792
孤独总比滥情好
孤独总比滥情好 2021-01-13 15:22

I would like to send HTML email with graphic elements included. I have no idea to attach garaphics to this email.

4条回答
  •  执念已碎
    2021-01-13 16:09

    The short version is that you are probably best off creating a HTML formatted messages, and using the header parameter of the php mail function.

     $headers = "From: sender@example.com\n" .
        "MIME-Version: 1.0\n" .
        "Content-type: text/html; charset=iso-8859-1";
     mail(to@example.com, 'subject line', 'your message text with HTML in it', $headers);
    

    The sitepoint.com article referenced by Jimmy provides an excellent and complete description of your options.

提交回复
热议问题