How can I send a HTML format email with pictures using PHP? I want to have a page with some settings and a HTML output which is sent via email to an address. What should I do? The main problem is to attach files.how can i do that?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Is there a way to play audio on a mobile browser w
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.It is pretty simple, leave the images on the server and send the PHP + CSS to them...
It is this line that tells the mailer and the recipient that the email contains (hopefully) well formed HTML that it will need to interpret:
Here is the link I got the info.. (link...)
You will need security though...