Send a message with Codeigniter

its my controller

    $to = "goeboekimutcs@gmail.com";
    $subject = "Goeboek I-Mut";
    $content = "<html><body><p>Test Content</p></body></html>";
    $headers = "From: goeboekimutcs@gmail.com";
    mail($to, $subject, $content, $headers);

this is my php.ini

; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "\"D:\Programs\xampp\sendmail\sendmail.exe\" -t"

; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the D:\Programs\xampp\mailoutput folder
; sendmail_path="D:\Programs\xampp\mailtodisk\mailtodisk.exe"

this is my sendmain.ini

smtp_server=smtp.gmail.com

; smtp port (normally 25)

smtp_port=587
auth_username= goeboekimutcs@gmail.com
auth_password= **

I open my controller in my browser, after downloading, update my gmail, but emails do not come. Sometimes it is sent, but often not sent. what happened?

+4
source share
1 answer

It is better to use a third-party library to send emails of the type PHPMailer, which will save you from many headaches. All you have to do is set some initial configurations.

Here you can get the latest update, as well as use:

PHPMailer Github Link

+1
source

Source: https://habr.com/ru/post/1589117/


All Articles