I am using CI email module, but it's not working. I don't have SMTP credentials, so trying this code to work for me.
$this->load->library('email');
// Send Emails
$config = Array(
'mailtype' => 'html'
);
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from($from);
$this->email->to($to);
$this->email->subject($title);
$this->email->message($message);
//$this->email->send();
if ($this->email->send()) {
$this->email->clear();
return true;
} else {
die(show_error($this->email->print_debugger()));
//return false;
}
It's giving this error
Emails usually are sent by email servers.
If you don't specify a SMTP server, your email module is trying to send emails using built-in php email function.
But this function does not do magic. It also need a fully functional SMTP server/agent.
By default, on Unix platforms it uses local SMTP server, specified in php.ini sendmail_path
. On Windows, you need to specify it in SMTP
parameter.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.