CodeIgniter Forums

Full Version: HTML Email gone crazzzzzzzzzzzy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Funky Fresh[/eluser]
Hey All,

I have been looking at all the posts on this forum about the weird chars that get inserted into HTML email.

I cant find a solution, i have been through the user guides, forum posts, google but none of the ideas seem to work for me .... i am posting my code below

This is my print_debugger for the email

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

User-Agent: CodeIgniter
Date: Sun, 21 Feb 2010 22:45:57 +1100
From: "Me"
Return-Path:
Reply-To: "Me"
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_4b811cf547267"

This is a multi-part message in MIME format.
Your email application may not support this format.

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

Welcome to My Site,

To complete your free trial registration, click:

http://www.link.com/index.php/auth/activate/30/5e9e2c26d0ff822293f7d6285b199617


Please verify your email within 48 hours, otherwise your registration will
become invalid and you will have to register again.


Thank You


--B_ALT_4b811cf547267
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
=?iso-8859-1?Q?Login_Information_and_Confirmation?=
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.=
w3.org/TR/html4/loose.dtd">
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Welcome to My Site - Activate Your Account&lt;/title&gt;
&lt;/head&gt;

&lt;body bgcolor=3D"#FFFFFF"&gt;

&lt;/body&gt;
&lt;/html&gt;

--B_ALT_4b811cf547267--

Theres no css and its still putting that damn 3D tag in there ... when theres more code, it also put's = at the end of every line and . all over the place.

i have made a new config file called email.php and the contents are as follows:

Code:
$config['mailtype'] = 'html';
$config['charset'] = 'iso-8859-1';
$config['newline'] = '\r\n';
$config['crlf'] = '\r\n';

The actual code of the email is

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Welcome to &lt;?php echo $site_name; ?&gt; - Activate Your Account&lt;/title&gt;
&lt;/head&gt;

&lt;body bgcolor="#FFFFFF"&gt;

&lt;/body&gt;
&lt;/html&gt;

and the function that im using to call the email stuffs is as follows:

Code:
function _send_email($type, $email, &$data)
    {
        $this->load->library('email');
        $this->email->from($this->config->item('webmaster_email', 'demon_auth'), $this->config->item('website_name', 'demon_auth'));
        $this->email->reply_to($this->config->item('webmaster_email', 'demon_auth'), $this->config->item('website_name', 'demon_auth'));
        $this->email->to($email);
        $this->email->subject(sprintf($this->lang->line('auth_subject_'.$type), $this->config->item('website_name', 'demon_auth')));
        $this->email->message($this->load->view('email/'.$type.'-html', $data, TRUE));
        $this->email->set_alt_message($this->load->view('email/'.$type.'-txt', $data, TRUE));
        $this->email->send();
        echo $this->email->print_debugger();
    }

If anybody could help me, or guide me it would be great ... i have a feeling its to do with the

Code:
Content-Transfer-Encoding: quoted-printable

but cant find anywhere to force it to something else.

Pleaseeeeeeeeee help Smile

El Forum

[eluser]codepotato[/eluser]
Think i solved this :

http://ellislab.com/forums/viewthread/69463/#811241