Welcome Guest, Not a member yet? Register   Sign In
trouble sending email controller
#6

(10-06-2019, 08:04 AM)jreklund Wrote: And are mail() configured on the server? If you are using a VPS you need to configure it yourself.
Not using VPS 
I have another controller where email is sent out without any issue 

I do have set in core/my_controller the following, and the reason why i had used sent_email instead of email 

/* Mail Send */
public function send_mail($email, $subject, $message)
{
$config = array(
'protocol' => 'SMTP',
'smtp_host' => 'mail.xxx.biz',
'smtp_port' => 25,
'smtp_user' => '[email protected]',
'smtp_pass' => 'Test@123##',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE,
'charset'  => 'utf-8',
'priority' => '1',
);
$this->load->library('email',$config);
$this->email->set_newline("\n");
// $this->email->from('[email protected]',"title email");
$this->email->from('[email protected]',"subject");
$this->email->to($email); 
$this->email->subject($subject);
$this->email->message($message);
return $this->email->send();
}

or even this one

public function send_mail_cart($email, $subject, $message)
{
$this->load->library('PHPMailer/phpmailer');
$mail = new PHPMailer();
$mail->IsSMTP(); 
$mail->Host = "smtp.gmail.com";  // specify main and backup server
$mail->SMTPAuth = true;    // turn on SMTP authentication
$mail->Username = "[email protected]";  // SMTP username
$mail->Password = "xxxxx@1234"; // SMTP password
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->From = "[email protected]";
$mail->FromName = "title email ";
$mail->AddAddress($email);
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->Body    = $message;
if(!$mail->Send())
{
  return false;
}
else
{
return true;


could i adapt any of the above??
Reply


Messages In This Thread
trouble sending email controller - by pmcr - 10-05-2019, 08:50 PM
RE: trouble sending email controller - by pmcr - 10-06-2019, 02:48 AM
RE: trouble sending email controller - by pmcr - 10-08-2019, 12:29 AM
RE: trouble sending email controller - by pmcr - 10-08-2019, 12:31 AM
RE: trouble sending email controller - by pmcr - 10-08-2019, 07:20 PM
RE: trouble sending email controller - by pmcr - 10-08-2019, 07:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB