How to Send Email with SMTP: Proven Methods

How to Send Email with SMTP: Proven Methods
For beginners

Medium-sized and big companies need to be in constant contact with their customers. Every aspect of web communication should be set up on a professional level and be fail-safe because we all want our clients to be satisfied with the services provided.

By utilising SMTP, companies have the opportunity to notify customers about their new products in online or offline stores, send abandoned cart emails, monthly announcements on discounts, etc. So how can you send emails through your SMTP server?

Why Should I Send Email Using an SMTP Server?

Most businesses live or die by how well they connect with customers. Every message has to land in the inbox, and it has to look professional. A failed receipt or a missing reset link tanks user trust fast.

SMTP gives you that reliability. You can send email from your SMTP server to just a handful of users or to thousands at once. The same setup handles both transactional messages and larger campaigns.

Here are the common jobs people hand to SMTP:

  • Account emails like sign-up confirmations and password resets;
  • Order receipts, shipping updates, and invoices;
  • Abandoned cart reminders and re-engagement nudges;
  • Monthly newsletters and product announcements.

In short, if your app needs to talk to people, SMTP email sending is usually how it speaks.

Send Mail via SMTP: the Concept Behind

SMTP servers help send mass mailings more effectively

SMTP servers help send mass mailings more effectively

Let’s start with some theory on what SMTP is used for. The acronym itself stands for Simple Mail Transfer Protocol, a set of rules used to deliver email messages. Here’s a simple explanation of how exactly you send email through an SMTP server using the world-standard protocol.

  1. There is always the one who sends the email (the sender) and the one who receives the email (the recipient).
  2. To send and receive emails, the sender and recipient must have special software installed on their computers called an email client.
  3. When the sender has typed an email and clicked send, the email client communicates with the email server using a special SMTP protocol.
  4. Next, the sender’s email server interacts with the recipient’s email server, thereby transferring data to the recipient’s email account.
  5. Finally, following a special POP3 or IMAP protocol, the email is delivered from the recipient’s email server to their email client and as a result, the recipient can see the email in their mailbox.

You can use an SMTP server to send emails to hundreds of thousands of your customers, yet there are many diverse ways you can do this.

How to Send Email Using SMTP: Step-by-Step

You do not need to memorize the protocol commands to use it. Most of the work comes down to four steps: connect, authenticate, send, and test. The examples below use UniOne’s SMTP server, but the same routine applies to any provider.

Step 1: Open a connection

First, point your app at the right host and port. With UniOne, the settings are:

  • Host: smtp.eu1.unione.io or smtp.us1.unione.io (check your dashboard for correct value)
  • Port: 587 with STARTTLS (recommended), or 465 for implicit TLS

Use port 587 in most cases. Set your TLS or “secure” flag to off for 587, and on for 465. These two connection settings cover almost every setup.

Step 2: Authenticate

Next, prove who you are. SMTP authentication needs a username and a password.

With UniOne, the username is your user ID. You will find it in the bottom-left corner of your dashboard. The password is your API key, which works as the SMTP password. To get it, sign in, navigate to API key, at the top of your dashboard, and create or copy a token. Store that key in an environment variable, never in your code.

Step 3: Send the message

Now build the email itself. Every message needs a few basic fields:

  • From: a verified sender address you own
  • To: one or more recipients
  • Subject: a short, clear line
  • Body: plain text, HTML, or both

Your SMTP library inserts these values into the right calls and ships them over the connection. You do not write raw SMTP commands by hand. The library does that for you.

Step 4: Test before you go live

Always test before real users get anything. Most libraries let you verify the connection first, so you catch a wrong hostname or a bad key early. You can also send a message to yourself and read it on a few devices.

For a safer dry run, UniOne’s Email Testing tool lets you send with real SMTP credentials without hitting real inboxes. You can preview the message, check headers, and confirm that placeholders fill in correctly. Catching a broken layout here protects your deliverability later.

Should I Set Up My Own SMTP Server for Sending Email?

It depends on your email marketing targets. An email with SMTP is suitable for implementing a wide range of tasks — from sending a single email to successfully delivering to thousands of recipients in mere seconds. Most often, SMTP is used for transactional emails, mass mailings, or personal correspondence.

If you send mail SMTP from your own server, it will give you certain advantages over corporate ones or email providers like Gmail. This way you’ll get a low price, an attentive attitude on the part of developers, and good deliverability for mass mailings. But it requires you to first build a team of developers and maybe even consult with an IT specialist first to have an overall idea of how mass mailings work.

Sending emails via own SMTP server requires good hardware

Sending emails via own SMTP server requires good hardware

On the other hand, paid SMTP services send just as many emails as your own server, while doing it faster and in a more controlled way. Also, you don’t need to be an expert in IT to send emails via a special server — just get a subscription and do the preparatory setup. We’ll talk about this a little later.

The good thing about the use of SMTP servers is that it is quite simple to implement — there is extensive documentation and a large community for this protocol. Now let’s take a closer look at all these options to send mail through your SMTP server:

The most obvious is to use the servers of custom email service providers. Of course, mailers impose restrictions on the possible number of emails sent from one account: from several dozen to several hundred. An interesting detail here is that when you send an email from your browser based email client, it still passes through the SMTP server, but without your participation. Remember that the setup can be quite hard and you will most probably need to engage IT staff here.

Mail servers are rented out, too. A little bit of googling, and you can find those that fit your goals. Although, you have a limited amount of functions here and cannot fully arrange your SMTP server the way you want it to.

You can also use your hosting provider’s mail servers. When renting hosting (of any class) you get the opportunity to use its SMTP servers provided as part of the package. Of course, in this case, you can only send a limited number of emails per time period.

A self-configured server is the hardest option. If you have experience working with server software, you can configure a rented VPS/VDS (or even your home server) to work over the SMTP protocol. This way you need not only IT specialists at your side but also good, and I mean really good, computers capable of processing thousands of mailings.

Commercial SMTP Services. If you want to ensure a high level of delivery of emails that are not marked as spam every time you send them, but lack the necessary technical knowledge, then commercial SMTP services are an ideal solution. All you need to do is determine the required number of messages and choose a tariff plan for payment.

On these platforms, apart from the servers, you can find ready-made templates for different email marketing campaigns and neatly configured technical settings.

How to Send Email from SMTP Server: Practical Methods

Here is the good news. Once your SMTP settings are ready, the same credentials work with any software you use on your end. You plug the host, port, user ID, and API key into any mail library, and that library handles the rest. Below are the most common ways to send email with SMTP, with a deeper guide for each.

Sending Email via SMTP in PHP

PHP has mature tooling like PHPMailer and Symfony Mailer that wrap SMTP in a few lines. They handle attachments, HTML body, and multiple recipients for you. For a full walkthrough, see how to Send Email Using PHP.

Sending Email via SMTP in Python

Python ships with smtplib and the email packages in its standard library, so you can start with no extra installs. For richer messages, the same code grows easily. Learn how to Send an Email with Python.

Sending Email via SMTP in C#

In C#, you can use MailKit or the classic System.Net.Mail namespace to open an SMTP connection and send. It fits well into .NET apps and services. Here is how to Send email in C#.

Sending Email via SMTP in Node.js

Node.js developers reach for Nodemailer, the go-to library for SMTP. You create a transporter with your settings, then call one method to send. Read the full guide on how to Send Email with Node.js.

Sending Email via SMTP in Java

Java uses Jakarta Mail (formerly JavaMail) to talk to SMTP servers. It is verbose but dependable, and it suits large backend systems. See how to send Emails using Java.

Sending Email via SMTP in Outlook

Outlook is an email client app, not a library, so the only thing to do here is configuration. You add your SMTP settings to an account, then compose as usual. For larger sends, read how to send mass email in Outlook.

Sending Email via SMTP in Gmail

Gmail can be used as an SMTP relay for small volumes. Use the host smtp.gmail.com on port 587, and create an app-specific password instead of your regular one. Keep in mind that Gmail enforces strict daily limits (under 500 daily emails), so it suits testing more than production.

Common Issues When Sending Email with SMTP

Even a correct setup hits snags. Here are the four problems you will meet most often, and how to handle them.

Emails Go to Spam

A message that sends fine can still land in the junk folder. The usual cause is missing authentication. Set up SPF, DKIM, and DMARC for your sending domain so mailbox providers trust you. Watch your wording too, since spammy phrases and broken HTML hurt your score. UniOne sets up these records for you and flags possible spam blocks before they spread.

SMTP Authentication Errors

If the server rejects your login, you usually get a 535 error. The culprit is almost always the credentials. Confirm your username and use the API key as the password (for UniOne), not your account password. A quick connection check before sending will surface a bad key right away.

IP Reputation Problems

Mail servers judge you by the IP you send from. A shared IP with bad neighbors, or a brand-new one with no history, can drag your delivery down. Warm up new IPs slowly over a few weeks and keep your lists clean. A good provider adds extra volume and spamblocking protection to keep you off blacklists.

Connection Errors

Sometimes the connection itself fails. Many networks block port 25, so prefer 587 or 465. A timeout error often means a wrong host or a firewall in the way. A TLS mismatch points to the wrong security setting for your port. Verifying the connection first turns silent failures into clear messages.

If You Choose to Delegate This Difficult Stuff to the Service

Paid SMTP servers make it easier to send mass mailings

You can send mass mailings with no fuss if you choose a paid SMTP server

There are many free SMTP servers for mailing lists on the market. Usually, these are demo versions of paid services that will allow you to send a limited number of emails. However, if you do not want to configure and maintain your own server, you can try these dedicated services and use them for a reasonable fee.

If you want to know about companies that provide such services, read our article on The 10 Best SMTP Services. Here in UniOne, we also offer SMTP services for your business. Book a demo session with our experts and get your first 6 000 emails for free!

If you would rather build on top of a managed platform, UniOne offers a few tools that fit different needs.

  • SMTP Service: Connect at smtp.unione.io and send up to 150,000 emails per hour. It supports TLS, unsubscribe links, click tracking, and webhooks. Messages can run up to 10 MB in size.
  • Email API: When you outgrow SMTP, the HTTP API sends over HTTPS with faster delivery, built-in tracking, and bulk support. It is the better fit for high volume and automation.
  • Email Testing and Analytics: Preview messages, check headers, and track opens, clicks, and bounces from one dashboard.

FAQ

How Many Emails Can I Send via SMTP?

It depends on your provider and plan. Your own server is limited by your hardware and your IP’s reputation. A managed service lifts that ceiling. UniOne, for example, sends up to 150,000 emails per hour over SMTP, and you can move to its Web API when you need millions.

What are the risks of running your own SMTP server?

The main risks are deliverability and upkeep. Your IP or domain can land on a blacklist, and monitoring and getting removed takes time. You also have to patch security holes, watch server load, and keep your auth records correct. One missed update can send your sender reputation to the basement.

How can I improve email deliverability when using SMTP?

Start with authentication: SPF, DKIM, and DMARC are now non-negotiable. Send from a verified domain you own, not a free mailbox. Keep your lists clean, warm up new IPs slowly, and avoid spammy content. Closely monitor your bounces and complaints so you can fix problems early.

Should I set up my own SMTP server or use a paid service?

If you have a skilled ops team and a strong reason for full control, your own server can do the job. For everyone else, a paid service wins. It handles the infrastructure, sender reputation, and scaling, so you can focus on your product instead of your mailing hassles.

Related Articles
Insurance Email Marketing Examples: Proven Strategies for Higher Customer Retention
Blog
For beginners
Insurance Email Marketing Examples: Proven Strategies for Higher Customer Retention
Elevate your email marketing for insurance companies with proven strategies. Discover high-converting examples and templates to grow your client base.
Valeriia Klymenko
Valeriia Klymenko
04 december 2024, 13:22
9 Top MailerSend Alternatives for Transactional Email Deliverability
Blog
For beginners
9 Top MailerSend Alternatives for Transactional Email Deliverability
Not happy with MailerSend? We have reviewed the best transactional email competitors for MailerSend for your business!
Alexey Kachalov
Alexey Kachalov
12 march 2026, 12:01
Gym Email Marketing Guide To Raise Revenue and Earn Members’ Love
Blog
For beginners
Gym Email Marketing Guide To Raise Revenue and Earn Members’ Love
Set up email marketing for fitness that feels helpful, not pushy. Build clean lists, segment by goals, automate flows, and track revenue.
Vitalii Piddubnyi
Vitalii Piddubnyi
09 september 2025, 12:40