Sto utilizzando il seguente codice per inviare un messaggio di posta elettronica in formato HTML e testo semplice Multipart/Alternative. Le e-mail stanno inviando contenuti di qualità, tuttavia alcuni di loro vengono scoperti nei filtri antispam. Questo è il codice che sto usando.Posta PHP() Multipart/Alternative per email in formato HTML e testo semplice
$notice_text = "This is a multi-part message in MIME format.";
$plain_text = "Some Plain Text Here\n\n";
$html_text = '<html><head><title>Sample HTML Email</title></head><body>';
$html_text .= '<p>Some text will go here.</p>';
$html_text .= '<p><img src="http://www.mydomain.com/img/offers.jpg" /></p>';
$html_text .= '<p>Can\'t see the images? <a href="http://www.mydomain.com/print_offer.php?promo=' . $promo_code . '">Click here</a></p>';
$html_text .= '</body></html>';
$semi_rand = md5(time());
$mime_boundary = "==MULTIPART_BOUNDARY_$semi_rand";
$mime_boundary_header = chr(34) . $mime_boundary . chr(34);
$from = "Test Email <[email protected]>";
$subject = "Get Your Offers Here";
$body = "$notice_text
--$mime_boundary
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
$plain_text
--$mime_boundary
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
$html_text
--$mime_boundary--";
mail($email, $subject, $body,
"From: " . $from . "\n" .
"bcc: " . $bcc . "\n" .
"MIME-Version: 1.0\n" .
"Content-Type: multipart/alternative;\n" .
" boundary=" . $mime_boundary_header);
Che cosa sta causando l'ingresso nei filtri antispam? Quando invio l'e-mail come testo normale, vanno bene, è solo quando invio l'e-mail HTML che viene catturato. Qualsiasi aiuto sarebbe apprezzato. C'è altro che posso aggiungere alle intestazioni per aiutare con la prevenzione del filtro spam?
"Ottieni le tue offerte qui" - che attiva il filtro antispam interno. –