ilia Posted July 30, 2007 Share Posted July 30, 2007 Hello all, I've been trying to figure out this problem for days now - it's something that I "inherited" from the previous developer who worked for my present company, so this is especially difficult, as you can imagine. Basically, I got an admin page on my site, which allows the admin to send a mass email to all the subscribers. The email itself is composed using a .tpl file, with all the fields being pulled from different variables. Now, the problem is that if I use "text/html" content type, the HTML in the email does not get represented as it should be. When I use "multipart/alternative", the HTML is OK (at least in Thunderbird - there are still problems in Entourage), but somewhere in the process the header information gets attached to the top of the email body: From - Mon Jul 30 15:29:31 2007 X-Account-Key: account2 X-UIDL: UID745-1181575263 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 X-Mozilla-Keys: Return-Path: Delivered-To: 3-ilia@company.com Received: (qmail 20389 invoked from network); 30 Jul 2007 15:23:15 -0500 Received: from company.com (HELO localhost) (216.70.127.231) by company.com with SMTP; 30 Jul 2007 15:23:15 -0500 From: Company Reply-To: Company Subject: Subject MIME-Version: 1.0 Content-Type: multipart/alternative boundary: ECHOTAG This is the code that composes the headers and sends the email: $headers = array('From' => 'Company<do-not-reply@company.com>', 'Reply-To' => 'Company<do-not-reply@company.com>', 'Subject' => "$journalName TOC Alert: Volume $volume, Issue $issue", 'MIME-Version' => '1.0', 'Content-Type' => 'multipart/alternative', 'boundary' => 'ECHOTAG'); ...... $smarty->assign( 'user', $users[$i] ); $mailMessage = $smarty->fetch("email.toc_alert.html.tpl"); $message= str_replace("\\\"","'",$mailMessage); //$email=$users[$i]->email; $email = "ilia@company.com"; $mail = $smtp->send($email, $headers, $message); And all this is done on a Linux server. Appreciate any help in advance, ilia Quote Link to comment https://forums.phpfreaks.com/topic/62535-mail-problem-headers-part-of-body/ Share on other sites More sharing options...
ilia Posted July 31, 2007 Author Share Posted July 31, 2007 bump... Anybody? Quote Link to comment https://forums.phpfreaks.com/topic/62535-mail-problem-headers-part-of-body/#findComment-311902 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.