PHP mail on OctoberCMS 3

Hi! I’m trying to migrate a website from v2 to v3, I usually use the PHP mail option in Settings → Mail Configuration, but on v3 I don’t see it anymore, I just see the API’s, Sendmail, SMTP, etc.

I use Magic Forms to create contact and booking forms, and I can’t seem to get it done.
I’m not an expert, so I’ll appreciate any help!

Thanks in advance!

Hi @EMAD08

To send mail the same as mail() PHP function, you should configure the mailer in the following way:

MAIL_MAILER=sendmail

The host, user, password, port and encryption are not needed. At this point, you may check if it already works, but sometimes this next step is also needed.

Check the .env value in config/mail.php:

'sendmail' => env('MAIL_SENDMAIL', '/usr/sbin/sendmail -bs')

Set the sendmail path in .env. You can check sendmail_path at phpinfo(), but it’s usually this one.

MAIL_SENDMAIL='/usr/sbin/sendmail -t -i'
1 Like