Help get this topic noticed by sharing it on Twitter Twitter, Facebook Facebook, or email.
Pierre

Send HTML Email in PHP

Hello everybody

I have a problem when I send emails in HTML.
I only use the SMTP relay.

To send email, I use the CodeIgniter framework.

If I send text emails, I have no problem. However, if I send an HTML email, I get a blank email.

Here is my code:

$this->load->library('email');

$config = array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.sendgrid.net',
'smtp_port' => 25,
'smtp_user' => 'xxxxx',
'smtp_pass' => 'xxxxx',
);

$html = "My email body";

$this->email->initialize($config);

$this->email->from('my_email@my_email.com', 'My Name');
$this->email->to('my_email@my_email.com');
$this->email->subject('Email Subject');
$this->email->message($html);

$this->email->send();

Thanks

Pierre
1 person has
this problem
+1
Reply