Welcome Guest, Not a member yet? Register   Sign In
How can I send email from localhost using my gmail account.
#6

[eluser]Musaddiq Khan[/eluser]
I have used the following code and it generate some errors.

Code:
$config = Array(
  'protocol' => 'smtp',
  'smtp_host' => 'ssl://smtp.googlemail.com',
  'smtp_port' => 465,
  'smtp_user' => '[email protected]', // change it to yours
  'smtp_pass' => 'mypass', // change it to yours
  'mailtype' => 'html',
  'charset' => 'iso-8859-1',
  'wordwrap' => TRUE
);

      $message = 'Hello this is test message...';
      $this->load->library('email', $config);
      $this->email->set_newline("\r\n");
      $this->email->from('[email protected]'); // change it to yours
      $this->email->to('[email protected]');// change it to yours
      $this->email->subject('Resume from JobsBuddy for your Job posting');
      $this->email->message($message);
      if($this->email->send())
     {
      echo 'Email sent.';
     }
     else
    {
     show_error($this->email->print_debugger());
    }


Messages In This Thread
How can I send email from localhost using my gmail account. - by El Forum - 08-13-2014, 08:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB