Welcome Guest, Not a member yet? Register   Sign In
HTML emails sent as plain text
#11

[eluser]maverik11[/eluser]
I also have the problem, taht my HTML mail, that I send usig the email class does not display correctly. Outlook 2007 and GMX do display the HTML code directly.

Code:
function send($recipient, $message, $subject, $type = 'html') {

        $config['protocol'] = 'mail';

        $this->email->from('sender', 'Sender');
        $this->email->to($recipient);

        $this->email->subject($subject);
        $this->email->set_alt_message('HTML email');
        $this->email->message($message);

        $this->email->send();

        echo $this->email->print_debugger();

        //end send
    }

The message looks like this:

Code:
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta http-equiv="expires" content="0">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="pragma" content="no-cache">
        <link rel="stylesheet" type="text/css"
href="http://egamers.bilek.ws/standard.css">
        </meta>
        <title>Mailcheck</title>
    </head>
    <body><table>
    <tr>
        <td>From</td>
        <td>To</td>
        <td>Magazin</td>
    </tr>
        <tr>
<td>FEHLER </td>
<td>Betreff nicht </td>
<td>OK: test</td>
    </tr>
        <tr>
<td>FEHLER </td>
<td>Betreff nicht </td>
<td>OK: test2</td>
    </tr>
        <tr>
<td>content</td>
<td>content</td>
<td>PCGames 13/09</td>
    </tr>
    </table>    &lt;/body&gt;
&lt;/html&gt;

The debugger prints:

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

From: "eGamers Magazin Verleih"
Return-Path:
Reply-To: "#######"
X-Sender: #######
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <4baf38e82487b@######.##>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
=?utf-8?Q?PCGames_13/09?=
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt;
        &lt;meta http-equiv="expires" content="0"&gt;
        &lt;meta http-equiv="cache-control" content="no-cache"&gt;
        &lt;meta http-equiv="pragma" content="no-cache"&gt;
        &lt;link rel="stylesheet" type="text/css"
href="http://egamers.bilek.ws/standard.css"&gt;
        &lt;/meta&gt;
        &lt;title&gt;Mailcheck&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;&lt;table>
    <tr>
        <td>From</td>
        <td>To</td>
        <td>Magazin</td>
    </tr>
        <tr>
<td>FEHLER </td>
<td>Betreff nicht </td>
<td>OK: test</td>
    </tr>
        <tr>
<td>FEHLER </td>
<td>Betreff nicht </td>
<td>OK: test2</td>
    </tr>
        <tr>
<td>Content</td>
<td>content</td>
<td>PCGames 13/09</td>
    </tr>
    </table>    &lt;/body&gt;
&lt;/html&gt;
#12

[eluser]sophistry[/eluser]
if some email readers do display the HTML email properly and some do not, then the problem is with the HTML (or more likely, the email readers) not with the CI email class. the CI email class just sends your HTML, it is up to the email readers to properly format it.

check this: campaign monitor - a site that will help you understand why some email readers destroy your HTML email
#13

[eluser]Tominator[/eluser]
What is your config?

Look at this: http://ellislab.com/codeigniter/user-gui...email.html

Have you set "mailtype" to "HTML" (in your config)?
#14

[eluser]maverik11[/eluser]
Thanks for the hint, I totally forgot to actually add the value, but unfortunately the result is the same.
#15

[eluser]maverik11[/eluser]
Thanks for the hint, I totally forgot to actually add the value, but unfortunately the result is the same. Also I tested it in 3 different clients now and nowhere was the HTML displayed rendered.
#16

[eluser]Tominator[/eluser]
You can always use PHPMailer ... I love it Smile ... and it works
#17

[eluser]sophistry[/eluser]
oh, i see. i misread your initial post! i see now that you said it shows the HTML "directly" which i thought meant "properly" and "correctly".

it looks to me like that same thing is happening to your email as was happening to BohBoh's: there is no Subject: label in the header and the utf-8 encoded subject is getting stuffed in right before the HTML and confusing the reader into thinking it is text-only. perhaps something is going wrong in the construction of the email?




Theme © iAndrew 2016 - Forum software by © MyBB