How to send email using graphic via php

I would like to send an HTML email with graphic elements included. I do not intend to apply garafiki to this letter.

+4
source share
4 answers

You probably do not want to do the embedded attachment manually, it is much simpler and fewer errors associated with using a library, such as PHPMailer .
It can attach embedded images, or if you give it some HTML code, it will attach images on its own and modify the code to display them.

+6
source

You can try swift mailer

+4
source

I'm not going to mislead you, so instead let me link this great Sitepoint tutorial that explained it to me in plain English! - advanced-email-php

+3
source

The short option is that you are probably best off formatting the HTML 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 <strong>with HTML in it</strong>', $headers); 

The sitepoint.com site referenced by Jimmy provides an excellent and complete description of your capabilities.

+2
source

Source: https://habr.com/ru/post/1277353/


All Articles