Send HTML in email via PHP

后端 未结 8 2091
时光说笑
时光说笑 2020-11-22 03:13

How can I send an HTML-formatted email with pictures using PHP?

I want to have a page with some settings and HTML output which is sent via email to an address. What

相关标签:
8条回答
  • 2020-11-22 03:33

    Simplest way is probably to just use Zend Framework or any of the other frameworks like CakePHP or Symphony.

    You can do it with the standard mail function too, but you'll need a bit more knowledge on how to attach pictures.

    Alternatively, just host the images on a server instead of attaching them. Sending HTML mail is documented in the mail function documentation.

    0 讨论(0)
  • 2020-11-22 03:36

    The trick is to know the content id of the Image mime part when building the html body part. It boils down to making the img tag

    https://github.com/horde/horde/blob/master/kronolith/lib/Kronolith.php

    Look at the function buildMimeMessage for a working example.

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