Support the ongoing development of Laravel.io →
posted 1 year ago
Laravel
Last updated by @jeromnimoman 1 year ago.
0
moderator

Hello @jeromnimoman

For me it isn't clear, do you get an error from the code or didn't you receive the email? Because it can be a lot of different steps where it fails outside this code :)

0

hi, thank you for reply.

no I do not receive any error, neither in the laravel logs nor in the apache logs, the only log is that one of the function (journal.log), and no I do not receive the mail, sendmail is disabled in my environment, I really don't understand where the problem is, I installed phpmailer and it is included it should work

0
moderator

If I'm correctly you mean that it is using sendmail while that shouldn't be what it want.

I see this options that maybe can help.

//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Whether to use SMTP authentication
$mail->SMTPAuth = true;

Source: https://github.com/PHPMailer/PHPMailer/blob/master/examples/smtp.phps

0

Thank you again for your help, the problem is not directly related to phpmailer, the problem is that laravel should not use sendmail since I start a phpmailer instance from the controller and send the mail with phpmailer , we notice in the journal.log that

Sending with mail()Sendmail path: /usr/sbin/sendmail -t -i

Sendmail is used and not phpmailer, we also notice that :

X-Mailer: PHPMailer 6.8.1

This header is added by phpmailer, this problem is very strange, I can't find the reason, a laravel expert would be welcome in this thread

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.