1

mail is only sent when I used business email like(abc@abc.com) but when use gmail,Hotmail or yahoo mail it gives below error.

Controller

    $this->load->library("mailer");
    $mail = $this->mailer->load();
    $mail->isHTML(true);
    $mail->IsMAIL();
    $mail->setFrom('ballers999@gmail.com', 'Ballers');
    $mail->addAddress($to);
    $mail->Subject = $subject;
    $mail->Body = $message;
    $mail->send();

error message could cot instantiate mail function

Cœur
  • 37,241
  • 25
  • 195
  • 267
Amir Khan
  • 401
  • 5
  • 13
  • https://stackoverflow.com/questions/1297084/phpmailer-error-could-not-instantiate-mail-function – Sanjay Kumar Jul 19 '18 at 10:20
  • @SanjayKumar email is ok for custom domain but when i send it to someone gmail account it gives me this error could cot instantiate mail function – Amir Khan Jul 19 '18 at 10:24
  • I understand your phpMailer call is using PHP mail function to send email. Check if you can send email using SMTP. – SynapseIndia Jul 19 '18 at 13:11
  • You can't send *from* a gmail address unless you're sending through gmail (i.e. not your local server, which is what `mail()` uses), otherwise it will fail SPF checks. – Synchro Jul 19 '18 at 15:15

0 Answers0