Skip to main content

Sending E-mails from your applications using our local SMTP server

This article provides steps how to send emails from your applications running on websites.

ASP.NET / .NET 8 / .NET 9 Free hosting
If you don't already have our ASP.NET / .NET Free hosting, sign up for FREE at https://MonsterASP.net/.

Important: Outgoing SMTP for sending emails from hosted applications is only available for Premium plans.

1. Configuring SMTP in your hosted applications

If you need sending e-mails from applications running on your website, you can use our local SMTP server that does not require authentication and uses local port 25. Here is basic setup:

SMTP Server: siteXXXX.siteasp.net
SMTP Port: 25
Username:
Password:
EnableSsl: false

Replace siteXXXX.siteasp.net with your actual server hostname (see below).

2. Finding your SMTP Server Hostname

Control Panel > Manage yourdomain.com > Overview and here you find your SMTP server hostname as field Server.

SMTP.png

3. Example .NET script

This is simple example script for sending emails from your hosted application using our local SMTP server.


// SMTP server settings
var smtpServer = "siteXXXX.siteasp.net";
var smtpPort = 25;
var enableSsl = false;

// Email message settings
var fromEmail = "sender@yourdomain.com";
var toEmail = "recipient@example.com";
var subject = "Test Email";
var body = "This is a test email sent using .NET.";

// Create the email message
MailMessage mail = new MailMessage(fromEmail, toEmail, subject, body);

// Set up the SMTP client
SmtpClient smtp = new SmtpClient(smtpServer, smtpPort);
smtp.EnableSsl = enableSsl;

try
{
    smtp.Send(mail);
    Response.Write("Email sent successfully.");
}
catch (Exception ex)
{
    Response.Write("Error sending email: " + ex.Message);
}

4. Configuring SPF Record in DNS

SPF (Sender Policy Framework) helps delivery your emails to Gmail, Outlook, Hotmail and other providers. It tells receiving mail servers that our SMTP server is allowed to send emails for your domain, which improves your email delivery and credibility.

SPF record in DNS example:

Name: @  OR  yourdomain.com   (some DNS providers use domain name instead of @)
Type: TXT
Value: v=spf1 a:siteXXXX.siteasp.net ~all

5. Securing Contact Form Against Bots and Abuse

Important: Never launch your contact form without protection!

If you're building contact form, always make sure to secure it against spam and abuse. Without protection, bots (automated scripts) can fill out your form thousands of times, sending spam, wasting server resources or even causing real problems.

To stop this, use tools like:
Google reCAPTCHA – Easy to add and blocks most spam bots.
Cloudflare Turnstile – A privacy-friendly and free alternative to CAPTCHA.

or other similar anti-bot solutions.