You could check out open-source projects like Mailtrain, Postal, or Mailu as a starting point. They’re well-maintained and customizable. Alternatively, Postfix or SMTPmart are solid options if you want to work with established mail server software.