SMTP Configuration Guide

Complete instructions for setting up your email client or application to use Smarthost.MX as your SMTP relay service.

SMTP Setup

Professional email delivery

Basic SMTP Settings

Server Configuration

Standard Configuration
SMTP Server: smtp.smarthost.mx
Port: 587
Encryption: STARTTLS/TLS
Authentication: Required
Alternative Configuration
SMTP Server: smtp.smarthost.mx
Port: 465
Encryption: SSL/TLS
Authentication: Required
Recommended: Use port 587 with STARTTLS for the best compatibility and security.
Dedicated IP Plans: If your plan includes a dedicated IP address, your SMTP server address will be different from the standard smtp.smarthost.mx. Check the top of your Dashboard for your specific SMTP server address.

Authentication Credentials

Getting Your SMTP Credentials
  1. Log in to your Smarthost.MX Dashboard
  2. Go to the "Send From Addresses" section
  3. Add and verify an email address you want to send from
  4. Click "Show SMTP Credentials" for that address
  5. Use the displayed username and password in your email client
Important: Each "Send From" address has its own unique SMTP credentials. You must verify at least one address before you can send emails.
Critical: The "From" email address in your application or email client must exactly match the verified email address associated with your SMTP credentials. You cannot use SMTP credentials from one email address to send from a different email address.
Credential Format:

Username:
[email protected]

Password:
your-generated-password

These are generated automatically and are different from your account login.

Email Client Configuration

Microsoft Outlook
Outlook 2016/2019/365:
  1. Go to File → Account Settings → Account Settings
  2. Select your email account and click Change
  3. Click More Settings → Outgoing Server
  4. Check "My outgoing server (SMTP) requires authentication"
  5. Select "Use same settings as my incoming mail server"
  6. Go to Advanced tab
  7. Set Outgoing server (SMTP): 587
  8. Set Encryption: STARTTLS
You may need to create a new account profile if changing existing settings doesn't work.
Mozilla Thunderbird
Thunderbird Configuration:
  1. Go to Account Settings
  2. Select Outgoing Server (SMTP)
  3. Click Add or edit existing server
  4. Set Server Name: smtp.smarthost.mx
  5. Set Port: 587
  6. Set Connection Security: STARTTLS
  7. Set Authentication: Normal password
  8. Enter your SMTP username and password
Thunderbird usually auto-detects the correct settings when you enter smtp.smarthost.mx.
Apple Mail
macOS Mail Configuration:
  1. Go to Mail → Preferences → Accounts
  2. Select your email account
  3. Go to Server Settings
  4. In Outgoing Mail Server section:
  5. Set Host Name: smtp.smarthost.mx
  6. Set Port: 587
  7. Set TLS Certificate: None
  8. Set Authentication: Password
  9. Enter your SMTP credentials
Ensure "Use TLS/SSL" is checked for secure connection.
Gmail (Custom Domain)
Using Custom SMTP in Gmail:
  1. Go to Gmail Settings → Accounts and Import
  2. Click "Add another email address"
  3. Enter your custom email address
  4. In SMTP settings:
  5. Set SMTP Server: smtp.smarthost.mx
  6. Set Port: 587
  7. Select TLS encryption
  8. Enter your SMTP credentials
This allows you to send from your custom domain through Gmail's interface.

Programming Integration

Important: From Address Requirements

When configuring your application, the "From" email address must exactly match the verified email address associated with your SMTP credentials. Using mismatched addresses will result in authentication failures.

PHP Integration

Using PHPMailer (Recommended)
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;

$mail = new PHPMailer(true);

// Server settings
$mail->isSMTP();
$mail->Host = 'smtp.smarthost.mx';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'your_smtp_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;

// Recipients
$mail->setFrom('[email protected]', 'Your Name');
$mail->addAddress('[email protected]');

// IMPORTANT: The setFrom() email MUST match your verified address!

// Content
$mail->isHTML(true);
$mail->Subject = 'Test Email';
$mail->Body = 'This is a test email.';

$mail->send();
?>
Using PHP mail() Function
<?php
// Configure SMTP in php.ini or use ini_set
ini_set('SMTP', 'smtp.smarthost.mx');
ini_set('smtp_port', '587');
ini_set('sendmail_from', '[email protected]');

// For authentication, you'll need additional configuration
// PHPMailer is recommended for authentication support

$to = '[email protected]';
$subject = 'Test Email';
$message = 'This is a test email.';
$headers = 'From: [email protected]' . "\r\n" .
           'Content-Type: text/html; charset=UTF-8' . "\r\n";

// IMPORTANT: The From header MUST match your verified address!

mail($to, $subject, $message, $headers);
?>
The mail() function has limited SMTP authentication support. PHPMailer is recommended.

Python Integration

Using smtplib
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

# SMTP configuration
smtp_server = "smtp.smarthost.mx"
smtp_port = 587
smtp_username = "[email protected]"
smtp_password = "your_smtp_password"

# Create message
msg = MIMEMultipart()
msg['From'] = '[email protected]'  # MUST match your verified address!
msg['To'] = '[email protected]'
msg['Subject'] = 'Test Email'

# Add body to email
body = "This is a test email."
msg.attach(MIMEText(body, 'plain'))

# Connect to server and send email
try:
    server = smtplib.SMTP(smtp_server, smtp_port)
    server.starttls()  # Enable encryption
    server.login(smtp_username, smtp_password)
    text = msg.as_string()
    server.sendmail('[email protected]', '[email protected]', text)
    server.quit()
    print("Email sent successfully!")
except Exception as e:
    print(f"Error: {e}")

Node.js Integration

Using Nodemailer
const nodemailer = require('nodemailer');

// Create transporter
const transporter = nodemailer.createTransporter({
    host: 'smtp.smarthost.mx',
    port: 587,
    secure: false, // Use STARTTLS
    auth: {
        user: '[email protected]',
        pass: 'your_smtp_password'
    }
});

// Email options
const mailOptions = {
    from: '[email protected]', // MUST match your verified address!
    to: '[email protected]',
    subject: 'Test Email',
    text: 'This is a test email.',
    html: '

This is a test email.

' }; // Send email transporter.sendMail(mailOptions, (error, info) => { if (error) { console.log('Error:', error); } else { console.log('Email sent:', info.response); } });

Troubleshooting SMTP Issues

From Address Mismatch
Error Message:

"Authentication failed" or "Invalid sender address"

Common Cause:
  • From address doesn't match verified address
  • Using wrong SMTP credentials for the sender
Solution:
  • Ensure From address exactly matches your verified address
  • Use the correct SMTP credentials for that specific address
Authentication Errors
Common Causes:
  • Incorrect SMTP username or password
  • Using account login instead of SMTP credentials
  • Sender address not verified
Solutions:
  • Verify your sender address in the dashboard
  • Use the correct SMTP credentials for that address
  • Check that authentication is enabled
Connection Issues
Common Causes:
  • Firewall blocking SMTP ports
  • ISP blocking outbound SMTP
  • Incorrect server or port settings
Solutions:
  • Try port 465 with SSL instead of 587
  • Check firewall settings
  • Contact your ISP about SMTP restrictions