PDA

View Full Version : [PHP]problema invio mail con contenuto html


kratteo
13-07-2006, 13:33
ho un sito su un server aruba (hosting linux) e sto realizzando uno script per inviare email dirattamente dal sito
il problema che non riesco a far inviarle in formato html

assegno tutte le variabili all'header (reply, from, subject, mime, content, chartset, ecce ecc) e non mi da errori durante nell'invio, ma nemmeno arriva l'email non arriva se inserisco come content: text/html

email che arriva se al posto di text/html uso text/plain, ma arriva il codice html visibile :\


non so proprio dove sbattere la testa :muro: :muro:

max246
13-07-2006, 15:44
$headers .="From: TicinoCinema NewsLetter<info@ticinocinema.ch>\n";
$headers .="Content-Type: text/html; charset=iso-8859-1\n";
mail ($newsle['email'],"NewsLetter della settimana",$risultato_sql,$headers);


eccoti un'esempio :P penso che sia corretto..... almeno da me funziona ;)

kratteo
13-07-2006, 16:04
a me no -.-'


$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/html; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: BigShot.It\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '') . (($bcc != '') ? "Bcc: $bcc\n" : '');


$this->extra_headers = (($this->reply_to != '') ? "Reply-to: $this->reply_to\n" : '') . (($this->from != '') ? "From: $this->from\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: BigShot.It\n" . $this->extra_headers . (($cc != '') ? "Cc: $cc\n" : '') . (($bcc != '') ? "Bcc: $bcc\n" : '');


il primo non funziona il secondo si

max246
14-07-2006, 07:40
boh prova a fare delle prove, quando trovi quella che funziona usala.