Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Don404's avatar

Creating a Mailbox with Laravel?

Hello,

I am looking for a general direction of creating a mailbox with Laravel. I want to be able to add multiple domains, create multiple email address (like: "[email protected]", "[email protected]", "[email protected]", "[email protected]", etc.) and send and receive emails to that box.

So far I managed to gather the following information:

There is a good package for receiving emails and its called "laravel-mailbox" and it uses different drivers like MailGun, PostMark etc. The part with the sending email will not be a problem.

However I still can't figure out one thing. How can I create the email addresses and start receiving and sending with them? Do I need to do this with MailGun or PostMark, or do I have to do this elsewhere? Any information will be appreciated!

0 likes
19 replies
Don404's avatar

@bugsysha Thank you. I will look into it. As for the part of creating the email addresses any suggestions where is this done?

Don404's avatar

@bugsysha Can you point me out in the right direction? I can't really find these tutorials on Youtube and the documentation in question.

Sinnbeck's avatar

So you are looking into creating your own version of gmail etc? Outgoing mail is easy.. Incoming isnt

Don404's avatar

@Sinnbeck Yes, the part of the incoming emails will be handled by "laravel-mailbox" which will listen for for incoming emails from one of the supported drivers, which are Mailgun, Postmark, etc. And I will rely on their service, but so far I have only used them for SMTP drivers and not for something like this.

This is the reason I need a bit of assistance, as I am not really sure how to create the email addresses.

Snapey's avatar

@Don404 All mail will come to your server then you can put in the correct 'mailbox' or bin it.

Don404's avatar

@Snapey So, If I understand correctly. When I create a listener for let's say "[email protected]" I can deal with all the emails that come there as I see fit, and if someone is trying to send an email to "[email protected]" I can return an error that such address is not existing?

martinbean's avatar

@don404 I’d say if you’re asking these questions, then don’t get into the business of hosting email. Especially if you’re going to be charging someone, because if something goes wrong, they’re going to ask you where their emails have gone.

Just pay the couple of dollars or whatever it is to get a mailbox with a reputable company that has dedicated infrastructure, and then sell them to your customers with a mark-up.

Self-hosting client sites is rarely worth the hassle. Building and maintaining a mailbox service definitely won’t be.

Don404's avatar

@martinbean I am not looking to sell the mailbox, just to create a place where I can receive and send emails from the domain names I own.

Snapey's avatar

@Don404 don't build your own app for this. There is FAR more to it than just collecting text

Don404's avatar

@Sinnbeck I am looking to make the mailbox as I want to receive all incoming emails to one place, instead of checking every single email of every single domain and then replay to the emails there.

Can google or protonmail add incoming mails from multiple domains on one place?

I am imagining a place where I can check all new emails at once and can reply to them from there, without the need to change boxes and login in every place etc.

martinbean's avatar

Can google or protonmail add incoming mails from multiple domains on one place?

@Don404 Yes. I use Google Mail myself for that very reason.

I receive emails from various domains (and addresses) into one inbox. And I can also select the address I want to reply with.

Please or to participate in this conversation.