Very short snippet: inviare email in HTML con PHP

Il codice necessario e sufficiente per inviare una semplice email in formati HTML, tramite il comando mail() di PHP è:

1
2
3
4
5
6
7
// preparo l'header per indicare il formato HTML
$headers = "MIME-Version: 1.0\n".
    "Content-type: text/html; charset=utf-8\n".
    "From: Undolog.com <info@undolog.com>\n".
    "Bcc: Copia <g.fazioli@undolog.com>\n";

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

Un commento a: “Very short snippet: inviare email in HTML con PHP”

  1. 28 gen, 2012 datrix:

    Grazie mille! :)

Lascia un commento

TAG XHTML PERMESSI: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERIMENTO CODICE:
<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