SMTP Configuration
OMailer manages SMTP connections through OM_SMTP. Multiple named connections are supported — one is designated primary, one optional backup.
Supported Providers
| Provider | Host | Port | Encryption |
|---|---|---|---|
| Gmail / Google Workspace | smtp.gmail.com | 587 | TLS |
| Microsoft 365 / Outlook | smtp.office365.com | 587 | TLS |
| Amazon SES | region-specific | 587 | TLS |
| Zoho Mail | smtp.zoho.com | 587 | TLS |
| Custom / Generic | configurable | configurable | TLS or SSL |
Gmail: Requires a Google App Password — standard account passwords are rejected. Enable 2FA first, then generate an App Password at myaccount.google.com.
Microsoft 365: SMTP AUTH must be enabled for the mailbox in Exchange Admin Center under Mail flow → Connectors.
Amazon SES: Use SMTP credentials (from IAM → SES SMTP Settings), not IAM access keys. Request production access to remove the sandbox sending limit.
Connection Data Structure
php[
'name' => 'My Gmail',
'provider' => 'gmail', // gmail|microsoft365|ses|zoho|custom
'host' => 'smtp.gmail.com',
'port' => 587,
'encryption' => 'tls', // tls|ssl
'auth' => true,
'username' => 'you@gmail.com',
'password' => '', // stored encrypted
'from_name' => 'Site Name',
'from_email' => 'you@gmail.com',
]
PHP API
php$smtp = new OM_SMTP();
// Get all saved connections
$connections = $smtp->get_connections();
// Save a new connection
$smtp->save_connection( 'conn_id', $data );
// Set which connection is primary / backup
$primary_id = $smtp->get_primary_id();
$backup_id = $smtp->get_backup_id();
// Send a test email
$result = $smtp->send_test( 'conn_id', 'recipient@example.com' );
// Returns: [ 'success' => bool, 'message' => string ]
// Encrypt / decrypt credentials
$encrypted = $smtp->encrypt_password( 'my-password' );
$plain = $smtp->decrypt_password( $encrypted );
WordPress Options
| Option | Contains |
|---|---|
om_smtp_connections | Array of all connection configs (passwords encrypted) |
om_smtp_routing | [ 'primary' => 'conn_id', 'backup' => 'conn_id' ] |
