UnderHost
Knowledgebase Docs

UnderMail SMTP Relay: send email from your website or application

Route website, application and server email through UnderMail SMTP Relay: when to use it, pricing, how to connect WordPress, PHP and Postfix, and the sending practices that protect your reputation.

On this page

UnderMail SMTP Relay is a managed outbound service for mail sent by websites, applications and business systems: password resets, order confirmations, contact-form messages, newsletters and campaigns. Every message is analyzed and scored before delivery, and UnderHost monitors the relay's IP reputation and blacklists so problems are caught early.

When to use SMTP Relay

You need to...Use
Give people mailboxes to read and reply toUnderMail email hosting
Send mail from a website, app or serverSMTP Relay
Send newsletters or campaignsSMTP Relay
Send mail from a VPS or dedicated server where outbound port 25 is blockedSMTP Relay

To protect the network's reputation, UnderHost may block outbound port 25 by default on VPS, Cloud VPS and dedicated servers, and may require an authenticated relay. A relay is the reliable way to send from those servers. See Port 25 policy.

Pricing

SMTP Relay starts at $4.95 USD per month, plus $0.30 USD per 1,000 emails sent. You pay for the volume you actually send. See the UnderMail page for current pricing.

How the relay works

  1. Your application connects

    Your website, application or mail server hands outgoing messages to the relay using SMTP with a login.

  2. The relay checks each message

    Smart analysis, scoring and outbound filtering flag messages that could hurt your sending reputation.

  3. The relay delivers

    Messages go out through deliverability-focused routing, while IP reputation monitoring and real-time blacklist alerts keep you informed.

Order and get your details

Order UnderMail - Email Relay Service in CustomerPanel under Email Solutions, or from the UnderMail page. After the order you receive the relay's server name, port and login. The examples below use these placeholders:

PlaceholderReplace with
RELAY_HOSTThe relay server name from your account details
RELAY_PORTThe port from your account details
RELAY_USER, RELAY_PASSYour relay login

Also add the SPF and DKIM records provided for your sending domain, so receiving servers trust mail the relay sends for you. See SPF, DKIM and DMARC.

Connect WordPress

WordPress sends mail through PHP by default, which is often filtered. Install an SMTP plugin such as WP Mail SMTP or FluentSMTP, choose Other SMTP, and enter:

  • SMTP host: RELAY_HOST, port: RELAY_PORT
  • Encryption: the TLS setting that matches your port (STARTTLS for submission ports, SSL/TLS for implicit TLS)
  • Authentication: on, with RELAY_USER and RELAY_PASS
  • From address: an address on your own domain, such as no-reply@yourcompany.com

Send the plugin's test email, then try a real form on your site.

Connect a PHP application

PHPMailer
use PHPMailer\PHPMailer\PHPMailer;

$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'RELAY_HOST';
$mail->Port       = RELAY_PORT;
$mail->SMTPAuth   = true;
$mail->Username   = getenv('RELAY_USER');   // keep credentials out of the code
$mail->Password   = getenv('RELAY_PASS');
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;  // or ENCRYPTION_SMTPS for implicit TLS

$mail->setFrom('no-reply@yourcompany.com', 'Your Company');
$mail->addAddress('customer@example.com');
$mail->Subject = 'Your order confirmation';
$mail->Body    = 'Thank you for your order.';
$mail->send();

Laravel, Symfony and most frameworks have the same settings in their mail configuration: host, port, encryption, username and password. Store the password in your .env file, not in Git.

Relay a whole server (Postfix)

On a VPS or dedicated server, you can send all of the server's outgoing mail through the relay:

as root
# /etc/postfix/main.cf
relayhost = [RELAY_HOST]:RELAY_PORT
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt

# store the login and secure it
echo "[RELAY_HOST]:RELAY_PORT RELAY_USER:RELAY_PASS" > /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
systemctl reload postfix

# send a test and watch the log
echo "Relay test" | mail -s "Relay test" you@example.com
tail -f /var/log/maillog      # Debian/Ubuntu: /var/log/mail.log

Install the SASL modules first if Postfix reports an authentication error: cyrus-sasl-plain on the Red Hat family, libsasl2-modules on Debian and Ubuntu.

Sending practices

  • Use a recognizable sender: a real address on your own domain, with a clear name.
  • Keep SPF, DKIM and DMARC up to date for every domain you send from.
  • Send only to people who asked for it. Use opt-in lists and an unsubscribe link in newsletters.
  • Watch bounces and complaints. Remove addresses that bounce, and act quickly on spam complaints.
  • Separate types of mail where you can, so a campaign problem does not delay password resets.

FAQ

From $4.95 USD per month, plus $0.30 USD for every 1,000 emails sent.
Yes. The relay is designed for transactional mail, newsletters, campaigns and business communication. Send only to permission-based lists, and follow the Acceptable Use Policy.
Usually, yes. Outbound port 25 may be blocked by default on VPS and dedicated servers. The relay accepts authenticated mail from your server and delivers it for you.
No. SMTP Relay is a separate service. Use it with your own website or server, and keep your mailboxes wherever you like.

Related: UnderMail email hosting | Port 25 policy | Email not sending | Email blacklists

Was this article helpful?

Need email hosting?

UnderHost shared and managed hosting include mailbox, webmail, DNS, SPF/DKIM, and email support for your domain.

Related articles

Back to Email