CodeIgniter
To send email with CodeIgniter and SendGrid, configure CodeIgniter's built-in email library to use SendGrid's SMTP relay. See the CodeIgniter email library documentation for more information.
(information)
Info
Use the correct end of lines with "crlf" => "\r\n" and "newline" => "\r\n".
1<?php2$this->load->library('email');34$this->email->initialize(array(5'protocol' => 'smtp',6'smtp_host' => 'smtp.sendgrid.net',7'smtp_user' => 'apikey',8'smtp_pass' => 'sendgridapikey',9'smtp_port' => 587,10'crlf' => "\r\n",11'newline' => "\r\n"12));1314$this->email->from('your@example.com', 'Your Name');15$this->email->to('someoneexampexample@example.com');16$this->email->cc('another@another-example.com');17$this->email->bcc('them@their-example.com');18$this->email->subject('Email Test');19$this->email->message('Testing the email class.');20$this->email->send();2122echo $this->email->print_debugger();23?>