简体   繁体   中英

Mail::send() with 'mail' driver is not delivered

So I just started using Laravel, and right now I want to send a email with the Mail::send() method without using smtp. I wan't to send the email anonymously because it is for a school project, so simple is good and I don't want to share my password.

If I enter my Gmail account, everything works perfectly, but when I set the mail driver to 'mail' so it uses the default php mail() function, it is not delivered.

I tried unsetting all the values in mail.php (username, pass, host, port and encryption) without success.

Also, I'm using localhost (MAMP) to send the email, I don't know if that is maybe an issue.

PS, it is not in spam either. (wouldn't even matter if it did since it's for school)

mail() requires a mail transport agent (like UNIX sendmail or postfix) to be present and configured on the server. The function doesn't "send emails anonymously", it just passes the message to the MTA (if present) and returns a boolean value indicating whether it was accepted for delivery or not.

If it's just a school project you're working on, stick with gmail, because setting up an MTA is usually a tedious work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM