Welcome Guest, Not a member yet? Register   Sign In
Extra characters coming in email
#1

[eluser]Computerzworld[/eluser]
Hello,
I have used CI email class for sending email. But when the mail comes it inserts character '=' at random places. I have created template for generating email body. Here is my email controller function.
Code:
function subscriptionMail($username,$email)
    {
        $this->load->library('parser');
        
        $config['protocol'] = 'mail';
        $config['mailtype'] = 'html';
        $this->load->library('email');
        $this->email->initialize($config);
        $this->email->from('[email protected]', 'Administrator');
        $this->email->to($email);
        
        $this->email->subject('TV Schedule Subscription');
        
        $body ="<table>";
        $body .="<tr><td>Hello ".$username.",</td></tr>";
        $body .="<tr><td>You recently requested a TV Schedule email subscription </td></tr>";
        $body .="<tr><td>Now onwards we will send email message if we will be having new TV Schedule content.</td></tr>";
        $body .="<tr><td>Cheers.</td></tr>";
        $body .="</table>";
        
        $mailBody = $body;
        
        $data = array(
        "BODY" => $mailBody,
        );
        
        $this->email->message($this->parser->parse('admin/mailTemplate',$data));
        $this->email->send();
        
        
    }

And here is the template file which is used for generating mail body.
Code:
&lt;html&gt;
&lt;head&gt;
&lt;style type="text/css"&gt;
body
{
font-family:Verdana;
font-size:12px;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
<p align="left">
{BODY}
<br>
<br>
</p>
&lt;/body&gt;
&lt;/html&gt;

Please help me to find what is the problem behind this? Thanks in advance...
#2

[eluser]Pascal Kriete[/eluser]
It's almost certainly your css. Try stripping all style from the message and then slowly rebuild. Also remember that different email clients render emails differently. If it works in an old version of Outlook it'll work in most.
#3

[eluser]Computerzworld[/eluser]
thanks for the reply.....
i 'll check it out....
#4

[eluser]delmi[/eluser]
I had the same problem...
I spent almost half a day to understand why my html email was full of "=" and strange characters

Finally I installed PHPMailer (http://phpmailer.codeworxtech.com) as a CI Plugin and everything worked well.

So it seems a CI EmailClass issue.

Hope it helps
Ciao

Angelo




Theme © iAndrew 2016 - Forum software by © MyBB