'US East (N. Virginia)', 'us-west-2' => 'US West (Oregon)', 'eu-west-1' => 'Europe (Ireland)', 'eu-central-1' => 'Europe (Frankfurt)', 'ap-south-1' => 'Asia Pacific (Mumbai)', 'ap-southeast-1' => 'Asia Pacific (Singapore)', 'ap-southeast-2' => 'Asia Pacific (Sydney)', ); foreach ( $ses_regions as $region => $name ) { // phpcs:ignore PluginCheck.CodeAnalysis.Offloading.OffloadedContent -- An SMTP server host name offered as a preset; nothing is loaded from it. $presets[] = self::row( 'ses-' . $region, 'Amazon SES — ' . $name, 'email-smtp.' . $region . '.amazonaws.com', 587, 'tls' ); } $presets[] = self::row( 'brevo', 'Brevo', 'smtp-relay.brevo.com', 587, 'tls' ); $presets[] = self::row( 'mailgun-us', 'Mailgun (US)', 'smtp.mailgun.org', 587, 'tls' ); $presets[] = self::row( 'mailgun-eu', 'Mailgun (EU)', 'smtp.eu.mailgun.org', 587, 'tls' ); $presets[] = self::row( 'sendgrid', 'SendGrid', 'smtp.sendgrid.net', 587, 'tls' ); $presets[] = self::row( 'postmark', 'Postmark', 'smtp.postmarkapp.com', 587, 'tls' ); $presets[] = self::row( 'zoho', 'Zoho Mail', 'smtp.zoho.com', 465, 'ssl' ); // No Microsoft 365 or Outlook.com preset: Microsoft ended password (basic-auth) SMTP for // personal accounts in 2024 and has retired it for Exchange Online, so SMTP there needs // OAuth, which this feature deliberately does not do. A preset that cannot work is worse // than no preset at all. $presets[] = self::row( 'gmail', 'Gmail / Google Workspace', 'smtp.gmail.com', 587, 'tls' ); return $presets; } /** * What a provider needs that three fields cannot say. Render-time only: this translates. * * @param string $id Preset id. * @return string Empty when there is nothing to add. */ public static function note( $id ) { switch ( $id ) { case 'gmail': return __( 'Google needs an app password here, not your normal password. Create one in your Google account under Security, with 2-step verification on.', 'adminkeep' ); } return ''; } /** * One preset row. * * @param string $id Id. * @param string $label Label. * @param string $host Host. * @param int $port Port. * @param string $encryption none, ssl or tls. * @return array */ private static function row( $id, $label, $host, $port, $encryption ) { return compact( 'id', 'label', 'host', 'port', 'encryption' ); } }