Welcome Guest, Not a member yet? Register   Sign In
Html email being encoded as quoted-printable
#1

[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
#2

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

[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.
#4

[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
#5

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




Theme © iAndrew 2016 - Forum software by © MyBB