Demers94
2 years ago
103
5
Laravel

How to send emails without any services

Posted 2 years ago by Demers94

Hi everyone,

I'm trying to send out a simple email without using any service (mailgun, mandrill, etc).

Here's my .env file :

MAIL_DRIVER=mail
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

It's the default mailtrap stuff, but I changed the MAIL_DRIVER to mail instead of the default smtp.

Whenever I try to send an email, the page just keeps loading until it times out.

What am I doing wrong? Do I need to use the PHP built-in mail() function instead of Laravel's Mail facade? Do I need to fill out some credentials for the username/password when using the default mail driver?

I read in the docs that Laravel is using SwiftMailer, but I can't find any information on how to actually use it.

Thanks for the help!

Please sign in or create an account to participate in this conversation.