Search code examples
phpemailsmtpsilverstripesilverstripe-4

Create email server with SilverStripe


I know I can send emails from a custom domain in Silverstripe like from '[email protected]', but I am wondering is there a way to create email server using Silverstripe which will allow me to register new email addresses for users using the Silverstripe UI.

Idea is to create a domain and allow registering the users under the latter domain and also have some kind of a web client (or through outlook), so that the users can check their emails. Basically setup gmail (but with our custom domain) inside Silverstripe

I feel like this is a stretch, but I have 0 experience in Silverstripe and would like input on this from someone who knows more about this CMS.

Thanks!


Solution

  • In theory you could. Or at least you could make a Web Interface for some existing Mail Server using SilverStripe (or any other Web Framework).

    But you should seriously consider if that is really what you want to do.


    E-Mail Programms like Thunderbird, Outlook, ... will use SMTP and IMAP (or POP3) to connect to a MailServer to do the sending and receiving of E-Mails.

    PHP itself is not capable of being a mailserver (at least not practically). But PHP does have ways to connect to SMTP or sendmail (Sending emails) and IMAP (Reading received emails).

    So, yeah, you could use PHP and SilverStripe to build a E-Mail Client and then connecting to an actual Mail Server.

    But, why would you? Building a reliable and feature rich email webclient is months of work.
    If your goal is really to just selfhost some emails, there are many existing solutions like https://www.horde.org/apps/webmail/, https://roundcube.net/, https://squirrelmail.org/, ...

    Another useful link might be https://mailinabox.email/, it's a collection of tools to make hosting emails easier. It includes/installs a mailserver and roundcube.

    But even before hosting an existing solution, please do some reasearch into the subject of mail hosting. There are a lot of pitfalls and security concerns you need to be aware of.