Welcome Guest, Not a member yet? Register   Sign In
HTML email styling problem
#1

[eluser]matteus[/eluser]
When I try to send an email with the email class it all works and sends properly etc, however, when the email arrives in my Outlook 2000 inbox it doesn't render properly. I've also cc'd the email to my hotmail account and that looks just fine.
When I view the email->print_debugger() output I see the following:

Code:
Your message has been successfully sent using the following protocol: mail

User-Agent: CodeIgniter
Date: Mon, 7 Apr 2008 19:30:10 +0100
From: "dfndfn"
Return-Path:
Cc: [email protected]
Bcc: [email protected]
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_47fa683241bb9"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_47fa683241bb9
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

whwehweh


--B_ALT_47fa683241bb9
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Web Form Message
&lt;html&gt;&lt;body style=3D"margin:10px;padding:0;background:#CCC;"&gt;<p style=3D"fo=
nt-family: Calibri, Arial, Helvetica, sans-serif;font-size:14px;">dfndfn le=
ft the following enquiry:</p><p style=3D"font-family: Calibri, Arial, Helve=
tica, sans-serif;font-size:14px;">whwehweh</p>&lt;/body&gt;&lt;/html&gt;

--B_ALT_47fa683241bb9--

As you can see there are lots of style=3D's and equals signs messing it all up. I read on another forum post http://ellislab.com/forums/viewthread/69463/ something about this being how some email clients render equals sign so use inline styling but this is the actual codeigniter output and I am using inline styling so I'm not so sure that this is the case.

Also I have had a go at the same thing with zend framework and came back to codeigniter because the bcc sent straight to me instead of hiding the email address. It was rendering the html correctly in all email clients though.
If it not one thing it's another!

This is the rest of my setup in the contact form controller, if anyone can help I'd be hugely grateful:

Code:
$config['mailtype'] = 'html';
$config['protocol'] = 'mail';
            
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['wrapchars'] = 20;

$this->email->initialize($config);

$this->email->from($this->validation->email, $this->validation->name);
$this->email->to('[email protected]');
$this->email->cc('[email protected]');
$this->email->bcc('[email protected]');
            
            
$this->email->subject('Web Form Message');
$this->email->message('&lt;html&gt;&lt;body style="margin:10px;padding:0;background:#CCC;"&gt;<p style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size:14px;">'.$this->validation->name.' left the following enquiry:</p><p style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size:14px;">'.$this->validation->body.'</p>&lt;/body&gt;&lt;/html&gt;');

$this->email->set_alt_message($this->validation->body);


Messages In This Thread
HTML email styling problem - by El Forum - 04-07-2008, 12:59 PM
HTML email styling problem - by El Forum - 04-07-2008, 01:26 PM
HTML email styling problem - by El Forum - 04-07-2008, 03:00 PM
HTML email styling problem - by El Forum - 04-07-2008, 03:03 PM
HTML email styling problem - by El Forum - 04-07-2008, 04:11 PM
HTML email styling problem - by El Forum - 04-08-2008, 07:58 AM
HTML email styling problem - by El Forum - 04-08-2008, 10:24 AM
HTML email styling problem - by El Forum - 04-12-2008, 06:30 AM
HTML email styling problem - by El Forum - 11-01-2010, 05:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB