If your website sends emails to its users — whether it's an account activation email, a password recovery, or a purchase invoice — you've probably faced the issue where some of these emails don't reach the user or end up in the spam folder. Many developers initially turn to hosting and use the hosting's SMTP to send transactional emails. But this is a mistake and, in the long run, seriously damages your domain reputation and deliverability rate. In this article, we'll explain why hosting isn't a good option for transactional email and what the right alternative is.
What is Transactional Email and How Does It Differ from Newsletter Email?
Transactional Email refers to emails sent in response to a specific user action. These emails usually contain time-sensitive and important information: activation links, two-factor authentication codes, payment receipts, or password change notifications. The user expects these emails, and if they don't arrive, the user experience is severely damaged.
In contrast, Newsletter Email (Marketing Email) is sent in bulk and on a schedule to recipients who may not expect it. These two types of email are completely different in terms of technical requirements, spam rules, and user expectations. Transactional email must be immediate, reliable, and personalized.
Why is Hosting SMTP Not Suitable for Transactional Email?
Shared hosting is designed for website hosting, not for sending emails. When you use hosting for transactional email, you face several serious problems:
1. Rate Limit
Shared hosting typically has a limit on emails sent per hour — usually between 50 and 500 emails per hour. If your site grows and, for example, needs 2000 transactional emails in an hour during a discount campaign, the hosting will simply drop the rest or queue them. The result: users don't receive the activation link and leave the site.
2. Shared IP and Damaged Reputation
On shared hosting, you share an IP with dozens of other sites. If one of those sites sends spam or gets hacked, your IP gets blacklisted. In that case, even if your emails are completely legitimate, receiving servers (like Gmail or Yahoo) will send them straight to spam. You have no control over this situation.
3. Lack of Configured SPF and DKIM
For your emails to be considered authentic, you need to set up SPF, DKIM, and DMARC records in your domain's DNS. On shared hosting, these records are either not set up at all or are the same by default for all sites on the server. The result: your emails lack a valid digital signature and easily end up in spam.
4. No Reporting or Monitoring
When you send emails from hosting, you have no dashboard to see how many emails were delivered, how many were opened, and how many bounced. If your emails suddenly start going to spam, you won't notice until users complain.
Common Mistake: Many developers think that if they use PHPMailer or the hosting's SMTP, the problem is solved. But the issue isn't the library; it's the sending infrastructure. Even if your code is flawless, the IP and reputation of your hosting won't allow for good deliverability.
The Right Alternative: Dedicated Transactional SMTP Service
The industry standard solution is to use a dedicated transactional SMTP service. These services professionally manage the email sending infrastructure, and you simply connect to them via API or SMTP. Some well-known examples include: SendGrid, Amazon SES, Mailgun, and Postmark.
Key Benefits of a Transactional SMTP Service
- Dedicated IP or High-Reputation IP: You can get a dedicated IP or use shared IPs with high reputation that are continuously monitored.
- High Sending Rate: These services easily process tens of thousands of emails per hour.
- Automatic SPF, DKIM, and DMARC: The service provides you with the necessary records, and you just add them to your DNS.
- Analytics Dashboard: You can see delivery rate, open rate, bounce rate, and spam reports in real time.
- Webhook and API: You can connect sending events to your own system and manage errors.
How to Connect: A Practical Example with PHP
Suppose you want to use Amazon SES. First, you need to get the API keys from the AWS console. Then, using PHPMailer and SMTP settings, you establish the connection:
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'email-smtp.us-east-1.amazonaws.com';
$mail->SMTPAuth = true;
$mail->Username = 'YOUR_SES_SMTP_USERNAME';
$mail->Password = 'YOUR_SES_SMTP_PASSWORD';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom('noreply@example.com', 'Example Site');
$mail->addAddress($userEmail, $userName);
$mail->isHTML(true);
$mail->Subject = 'Account Activation';
$mail->Body = "Please click this link to activate your account.";
$mail->send();
echo 'Email sent successfully';
} catch (Exception $e) {
error_log("Error sending email: {$mail->ErrorInfo}");
}
Important note: Before sending, you must verify your domain in the SES console and add the following records to your DNS:
// SPF
example.com. TXT "v=spf1 include:amazonses.com ~all"
// DKIM (three CNAME records provided by AWS)
// DMARC
_dmarc.example.com. TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"
When Can You Still Use Hosting?
If your site is very small — for example, a personal blog that sends 5 to 10 transactional emails a day — you can temporarily use hosting. But even in this case, I recommend at least setting up SPF and DKIM records properly. For any site that intends to grow, set up a transactional SMTP service from day one. The cost of these services is usually based on sending volume, and for low volumes (e.g., 1000 emails per month), it's almost free or very cheap.
Troubleshooting Tips: Why Are My Emails Going to Spam?
If your emails are going to spam, check this checklist in order:
- Check SPF: Use the command
nslookup -type=TXT example.comto see if the SPF record exists and includes the sending IP. - Check DKIM: Test your email signature with tools like
dkimvalidator.com. - Enable DMARC: Start with
p=noneand after a month, move top=quarantine. - Review email content: Reduce spammy words like "free," "special discount," and "click here." Avoid heavy HTML with too many images.
- Keep bounce rate low: If more than 2% of your emails bounce, your reputation is severely damaged. Remove invalid addresses from your list.
Another Common Mistake: Some people think that adding the List-Unsubscribe header will save transactional email from spam filters. This header is only necessary for bulk emails and has no effect on transactional email. The most important things are IP reputation and the DKIM signature.
Conclusion: The Right Decision for Your Site
Transactional email is a critical part of the infrastructure of any serious website. Using hosting for this purpose is like trying to move a truckload of cargo with a passenger car — it might work a few times, but eventually, you'll break down. A dedicated transactional SMTP service, with a valid IP, digital signature, and precise reporting, is the only professional way to ensure critical emails reach users' inboxes.
If you're looking to set up transactional email for your site, first define your needs: monthly volume, growth rate, and budget. Then choose one of the reputable services and configure the DNS records correctly. This takes a few hours, but its impact on conversion rates and user trust is undeniable. Professional hosting services like ServerNet also provide the ability to use transactional SMTP services alongside hosting, making this path smoother for you.