Menu

SMTP Configuration

Configure your application to send emails through Mailloop's SMTP server.

3 min read

This guide covers how to connect your application to Mailloop's SMTP server, with examples in multiple languages.

Server Details

SettingValue
Hostsandbox.mailloop.io
STARTTLS Port587 (recommended)
SSL/TLS Port465
Alternate Ports25, 2525
AuthenticationRequired (sandbox credentials)

All ports accept the same authentication and deliver to the same inbox. Use port 587 or 465 unless your environment blocks them.

Language Examples

Node.js

JAVASCRIPT
const nodemailer = require('nodemailer');

const transporter = nodemailer.createTransport({
  host: 'sandbox.mailloop.io',
  port: 587,
  secure: false, // true for port 465
  auth: {
    user: 'your-sandbox-username',
    pass: 'your-sandbox-password'
  }
});

const info = await transporter.sendMail({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Test Email',
  text: 'This is a test email',
  html: '<p>This is a <strong>test email</strong></p>'
});

console.log('Email sent:', info.messageId);

Python

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

msg = MIMEMultipart('alternative')
msg['Subject'] = 'Test Email'
msg['From'] = '[email protected]'
msg['To'] = '[email protected]'

text = 'This is a test email'
html = '<p>This is a <strong>test email</strong></p>'

msg.attach(MIMEText(text, 'plain'))
msg.attach(MIMEText(html, 'html'))

with smtplib.SMTP('sandbox.mailloop.io', 587) as server:
    server.starttls()
    server.login('your-sandbox-username', 'your-sandbox-password')
    server.send_message(msg)
    print('Email sent successfully')

PHP

PHP
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'vendor/autoload.php';

$mail = new PHPMailer(true);

try {
    $mail->isSMTP();
    $mail->Host = 'sandbox.mailloop.io';
    $mail->SMTPAuth = true;
    $mail->Username = 'your-sandbox-username';
    $mail->Password = 'your-sandbox-password';
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
    $mail->Port = 587;

    $mail->setFrom('[email protected]');
    $mail->addAddress('[email protected]');

    $mail->isHTML(true);
    $mail->Subject = 'Test Email';
    $mail->Body = '<p>This is a <strong>test email</strong></p>';
    $mail->AltBody = 'This is a test email';

    $mail->send();
    echo 'Email sent successfully';
} catch (Exception $e) {
    echo "Error: {$mail->ErrorInfo}";
}

Ruby

RUBY
require 'mail'

Mail.defaults do
  delivery_method :smtp, {
    address: 'sandbox.mailloop.io',
    port: 587,
    user_name: 'your-sandbox-username',
    password: 'your-sandbox-password',
    authentication: :plain,
    enable_starttls_auto: true
  }
end

mail = Mail.new do
  from    '[email protected]'
  to      '[email protected]'
  subject 'Test Email'

  text_part do
    body 'This is a test email'
  end

  html_part do
    content_type 'text/html; charset=UTF-8'
    body '<p>This is a <strong>test email</strong></p>'
  end
end

mail.deliver!
puts 'Email sent successfully'

Testing Your Connection

Verify your credentials work using curl:

BASH
curl --url 'smtp://sandbox.mailloop.io:587' \
  --ssl-reqd \
  --mail-from '[email protected]' \
  --mail-rcpt '[email protected]' \
  --user 'your-username:your-password' \
  -T message.txt

If configured correctly, the email appears in your Mailloop inbox within seconds.

Email Addresses

Sender address (From): Can be any email address. Mailloop captures the email regardless of the sender.

Recipient address (To): Can be any email address. All emails are captured based on SMTP authentication, not the recipient address.

Sandbox address: Each sandbox has an address in the format [email protected]. This is useful when you need to receive emails from external sources.