Very short snippet: send email in HTML with PHP

The code necessary and sufficient to send a simple email in HTML format using the command mail() in PHP is:

1
2
3
4
5
6
7
/ / Prepare the header to indicate HTML
"MIME-Version: 1.0 \n " . $ Headers = "MIME-Version: 1.0 \ n".
"Content-type: text / html; charset = utf-8 \ n".
"From: Undolog.com <info@undolog.com> \ n".
"Bcc: Copy <g.fazioli@undolog.com> \ n";

"Destinatario <info@e-lementi.com>" , "Oggetto della mail" , "<p>Corpo della mail in <strong>HTML</strong></p>" , $headers ) ; mail ("Recipient <info@e-lementi.com>", "Subject of mail", "Body of email <p> <strong> HTML </ strong> </ p>", $ headers);

A comment: "Very short snippet: send email in HTML with PHP"

  1. January 28, 2012 datrix:

    Thank you! :)

Leave a comment

TAG XHTML PERMITS: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL 


Stop SOPA