Skip to content

Mail Server

Overview

The Mail Server service reads mail configuration from the central Setting store. It provides a clean API for resolving SMTP credentials, API tokens, sender addresses, and template preferences — all managed through the admin settings panel.

Key Methods

MethodDescription
getToken()Mail API token from settings
getInboxId()Mailtrap sandbox inbox ID
isSandbox()Whether mail driver is set to Mailtrap sandbox
getDefaultSenderEmail()From-address from settings or config fallback
getSmtpConfig()SMTP host, port, username, encryption
isEnabled()Master mail toggle
shouldQueue()Whether emails should be queued
getTemplate()Selected email template (basic, minimalis, professional)

Key Files

app/Services/MailServer/
├── ConfigurationService.php     # Mail config reader
├── EmailService.php             # Email sending logic
└── HttpClientService.php        # HTTP client for mail API