I read other topics but not resolved my problem..
I have this in my controller:
$this->load->library("email");
$this->email->from(set_value("email"),
set_value("nome"),set_value("msg"));
$this->email->to("my@gmail.com");
$this->email->subject("Mensagem");
$this->email->message(set_value("msg"));
$this->email->send();
echo $this->email->print_debugger();
and my library email:
var $useragent = "CodeIgniter";
var $mailpath = "/usr/sbin/sendmail";
var $protocol = "smtp";
var $smtp_host = "smtp.gmail.com";
var $smtp_user = "xxx@gmail.com";
var $smtp_pass = "xxx";
var $smtp_port = "465";
var $smtp_timeout = 5;
var $smtp_crypto = "";
var $wordwrap = TRUE;
var $wrapchars = "76";
var $mailtype = "html";
var $charset = "utf-8";
var $multipart = "mixed";
var $alt_message = '';
var $validate = FALSE;
var $useragent = "CodeIgniter";
var $mailpath = "/usr/sbin/sendmail";
var $protocol = "smtp";
var $smtp_host = "smtp.gmail.com";
var $smtp_user = "xxx@gmail.com";
var $smtp_pass = "xxx";
var $smtp_port = "465";
var $smtp_timeout = 5;
var $smtp_crypto = "";
var $wordwrap = TRUE;
var $wrapchars = "76";
var $mailtype = "html";
var $charset = "utf-8";
var $multipart = "mixed";
var $alt_message = '';
var $validate = FALSE;
...
I also change php.ini for: (wamp - bin - apache - apache2.4.4 - bin - php.ini)
extension=php_openssl.dll
But I have da same problem... not work:
Message: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
Filename: libraries/Email.php
Line Number: 1553 Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.
Line Number 1553 for email.php have this:
if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From']))){ return FALSE;}else{ return TRUE;}
if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this-_header_str, "-f ".$this->clean_email($this->_headers['From']))){
return FALSE;
}else{
return TRUE;
}
I need help... tks