• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with Google SMTP and sending emails as HTML

Hi guys,

I am hoping you can help I have now spent 5 days pulling my hair out on this.

I am trying to send a Html email but am having all sorts of issues.

My last and current issue is that, the email sends okay! and is received okay!

However everytime the html comes out as html in the body of the email.

I am sending hopefully via the Google mail SMTP however I am wondering if this is maybe the problem? as in my email header it actually references my server?

Could anyone please help out. My code is below. The code for the email is just a simple html, body with test in the middle.

$config = Array(
     'protocol' => 'smtp',
     'smtp_host' => 'ssl://smtp.googlemail.com',
     'smtp_port' => 465,
     'smtp_user' => '[email protected]',
     'smtp_pass' => 'xxxxxxx',
     'mailtype'  => 'html',
     'charset'   => 'iso-8859-1'
        $this->load->library('email', $config);

        $this->email->from('[email protected]');
        $this->email->to("[email protected]");
        $this->email->subject('Test Email');
        $body = $this->load->view('emails/order',null,TRUE);
        $data["summary"] = $config;
        $this->email->message( $this->load->view( 'emails/order', $data, true ) );
        if (!$this->email->send()){
     echo 'failed to load email';
        else {
     echo 'success sent email';

im gonna take 2 wild guesses:
1) have you tried adding this

2) if you have XSS filter globally set you can try do a test send without it, and if this is causing the problem but you need it set globally you can undo it just for this template with


Good luck buddy Smile

Hi Niki,

Thanks for the quick reply.

Due to the nature of having to get the job done I moved on and installed PHPMailer. Got this up and running in less than hour and it works perfectly with Google and sending html emails.

I will at somepoint go back and try your suggestions.

Note I checked and I do have xss turned on globaly.

Hey, glad you made it Smile
PHPmailer is also my personal favorite when it comes to deal with emails.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.