| Server IP : 66.241.125.127 / Your IP : 216.73.216.50 Web Server : Apache/2.4.67 (Debian) System : Linux 68372e0bd90938 6.12.91-fly #1 SMP PREEMPT_DYNAMIC Mon Jun 1 15:49:04 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /.fly-upper-layer/var/www/html/wp-content/mu-plugins/ |
Upload File : |
<?php
/**
* Plugin Name: RESPILON SMTP
* Description: Routes all WordPress/WooCommerce mail through an SMTP relay when the
* SMTP_* env vars (Fly secrets) are present. Provider-agnostic: works with
* Brevo, Resend, Mailgun, Postmark, Gmail, etc. Until secrets are set this
* is a no-op (WordPress on Fly has no local MTA, so mail just doesn't send).
*
* Fly secrets to set (see README):
* SMTP_HOST, SMTP_PORT (default 587), SMTP_USER, SMTP_PASS,
* SMTP_SECURE (tls|ssl, default tls), SMTP_FROM (default hei@antiakne.no)
*/
defined( 'ABSPATH' ) || exit;
add_action( 'phpmailer_init', function ( $mail ) {
$host = getenv( 'SMTP_HOST' );
if ( ! $host ) {
return; // not configured yet
}
$mail->isSMTP();
$mail->Host = $host;
$mail->Port = (int) ( getenv( 'SMTP_PORT' ) ?: 587 );
$mail->SMTPAuth = true;
$mail->Username = getenv( 'SMTP_USER' );
$mail->Password = getenv( 'SMTP_PASS' );
$mail->SMTPSecure = getenv( 'SMTP_SECURE' ) ?: 'tls';
$from = getenv( 'SMTP_FROM' ) ?: 'hei@antiakne.no';
try {
$mail->setFrom( $from, 'RESPILON Antiakne' );
} catch ( \Exception $e ) {
// ignore; fall back to default From
}
} );