CodeIgniter Forums
Html email being encoded as quoted-printable - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Html email being encoded as quoted-printable (/thread-2368.html)



Html email being encoded as quoted-printable - El Forum - 07-31-2007

[eluser]StlTemplar[/eluser]
G'day, im using the following code to send email

Code:
$html = "&lt;html&gt;&lt;body class='something'&gt;<p id='test'>Testing 123</p>&lt;/body&gt;&lt;html&gt;";

$this->load->library('email');
$this->email->initialize(array(
    'protocol' => 'sendmail',
    'mailtype' => 'html',
    'charset' =>'utf-8',
    'wordwrap' => FALSE,
));
$this->email->from('[email protected]');
$this->email->to($email_address);
$this->email->subject('Test subject');
$this->email->message($html);
$this->email->set_alt_message('Alternate Text');
$this->email->send();

The output of the email debugger is

Quote:User-Agent: CodeIgniter
Date: Tue, 31 Jul 2007 22:10:42 -0700
From: "XXX"
Return-Path:
To: XXX
Cc: XXX
Subject: XXX
Reply-To: "XXX"
X-Sender: XXX
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: multipart/alternative; boundary="B_ALT_46b015d2830f7"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_46b015d2830f7
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Alternate text


--B_ALT_46b015d2830f7
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

&lt;html&gt;&lt;body class=3D'something'&gt;<p id=3D'test'>Testing 123</p>&lt;/body&gt;&lt;html&gt;

--B_ALT_46b015d2830f7--

The problem is the html is being encoded as quoted-printable, which is messing up the html, is this an issue with Codeigniter, or with PHP ?

I have tried using mail, sendmail, and smtp to send email, with the same results.

Is there a way to force the encoding to not be quoted-printable ?

Thanks


Html email being encoded as quoted-printable - El Forum - 08-01-2007

[eluser]StlTemplar[/eluser]
Ignore this, I misunderstood how to use html email


Html email being encoded as quoted-printable - El Forum - 09-13-2007

[eluser]boteeka[/eluser]
Hi, maybe I'm stupid, but please share your findings, 'cause I've got the same issue here. :cheese:

Thanks in advance.


Html email being encoded as quoted-printable - El Forum - 09-13-2007

[eluser]StlTemplar[/eluser]
I think the problem i had was that i had a stylesheet attached to the email, and was using classes and ids for css, and i thought that quoted printable was messing up the class and id names.

But the real problem was that some (most?) email clients just ignore attached stylesheets, so use embeded styles instead Smile


Html email being encoded as quoted-printable - El Forum - 09-14-2007

[eluser]boteeka[/eluser]
Thanks for your reply. I will take a look.