Site icon Mailtrap

Stop Salesforce Email From Going to Spam

This image is a graphical representation of Salesforce emails going to spam for the article which covers the topic and prevention in detail.

In 2023, Salesforce.com is still the leading CRM used by organizations worldwide. 

What makes this CRM so greatly helpful is  its robust email capabilities, which enable contacting leads, customers, and other parties, easily and effectively.

Unfortunately, due to the strict spam filtering by email service providers, some Salesforce emails end up going to spam, thus leading to a low email marketing ROI, messages not reaching recipients, and of course, the time and effort put into creating the emails wasted.

So how can a Salesforce platform user stop their emails from bearing the “spam” label? By implementing the tips and proactive steps described in this article!

Let’s dig in!

Why are emails sent from Salesforce going to spam?

Labeling email messages as spam is the job of two actors – email service providers (ESPs)/ internet service providers (ISPs), and the email recipients themselves.

ESPs and ISPs use multiple parameters (more on that in a bit) to ensure an email is okay to land in a recipient’s main inbox. Email recipients, on the other hand, take a more independent approach and can send any email that isn’t relevant to them to the spam folder.

How relevant an email is, of course, varies from person to person. But, ESPs and ISPs do take notes from recipients when it comes to flagging emails and will directly send an email to spam if its sender has been flagged by a recipient multiple times before.

What are the other parameters used to categorize emails into spam and non-spam? There are quite a few, with the most common being:

It’s important to note that these are not the only parameters taken into consideration when an ESP, ISP, or email recipient is deciding whether or not an email belongs in the inbox or the well-hidden spam section. Still, making sure that none of the mentioned red flags are present when your emails go under inspection is the only way to make sure they do make it to the intended recipient.

How to prevent email from going to spam? (Salesforce knowledge base tips) 

Knowing why emails go to spam doesn’t mean one also knows how to prevent the same from happening. But don’t stress, as we’ve got you covered on that front as well!

Here are some useful tips you can follow! 

Check your settings 

In the Salesforce knowledge base, at the time of writing, it’s recommended to check your deliverability settings, DNS settings, as well as the settings of your email server.

Outbound email/deliverability settings

Configuring these settings can improve the email deliverability of your organization. And depending on the setting, it can apply to emails sent through Salesforce and emails sent through external accounts connected to Salesforce, or only emails sent through Salesforce or an email relay.

The settings include: 

DNS settings for your domain 

Configuring DNS settings for your domain includes the creation of an SPF record and a DKIM key. 

SPF is intended for checking if a message conforms to the policy described for a domain it comes from. The record is configured by the domain owner for each DNS zone.

DKIM, on the other hand, is a key used to sign outbound emails on behalf of your organization, so the recipient can make sure the messages have been processed as emails from your organization.

For more in-depth information on these authentication methods, check out our dedicated articles:

Email server settings 

Email server settings cover the settings necessary to set up an email relay. Using an email relay can help remove the “email spoofing” label some emails sent from Salesforce receive, but it also has other benefits, such as:

If you’re looking to reap the mentioned benefits by setting up an email relay but don’t have an email infrastructure in place yet, consider signing up for the Mailtrap Email Delivery Platform.

The platform, intended for businesses and individuals, ensures high deliverability rates as well as effortless maintenance. It also covers all email-related needs in one place: testing, sending, and in-depth tracking. So once you start using it, you have an end-to-end sending solution that will deliver your emails just in time!

How do you connect to the Mailtrap Email Delivery Platform through the email relay option in Salesforce? Well, depending on whether you want to test Salesforce emails or send Salesforce emails in mass/individually, the process will be slightly different.

Let’s start with testing!

Mailtrap Email Testing can be used to inspect and debug emails without spamming recipients in staging, development, and QA environments.

With the testing solution comes a range of features:

To add an email relay and through it connect to this email-testing solution, start by visiting the Mailtrap account creation page and use your email or an existing Google, Github, or Office 365 account to sign up.

Navigate to Email TestingInboxes to find your first virtual inbox called “My Inbox”.

Click on the inbox and find Show Credentials. This will reveal the credentials for the fake SMTP server used to send testing emails from an email client or mail transfer agent to your Mailtrap virtual inbox.

Go to your Salesforce Lightning account and navigate to SetupEmail (under Administration)Email Relays.

Click on Create Email Relay and fill out the form with Mailtrap Email Testing’s SMTP credentials you retrieved earlier, as shown in the example below: 

Click Enable SMTP Auth to connect to the SMTP server with authentication. After that, enter your SMTP username and password. 

Click Save and head to Email Domain Filters, where you need to click Create Email Domain Filter

On the Configure Email Domain Filter page, enter “*” as the default wildcard for Sender Domain and Recipient Domain. After that, mark the Active checkbox and click Save

Lastly, use the Apex code snippet below and run it using the Salesforce Developer Console to send a test email to your virtual inbox:

public class ApexEmailSample {
public static void sendEmail(String userEmail){
Messaging.reserveSingleEmailCapacity(20);

String[] toAddresses = new String[] { userEmail };
String[] toCcAddresses = new String[]{ '<cc.address@example.com>' }; // can be empty: new String[]{}
String[] toBccAddresses = new String[]{ '<bcc.address@example.com>' };// can be empty: new String[]{}

Messaging.SingleEmailMessage myMail = new Messaging.SingleEmailMessage();

myMail.setToAddresses(toAddresses);
myMail.setCcAddresses(toCcAddresses);
myMail.setBccAddresses(toBccAddresses);
myMail.setReplyTo('<reply.to@example.com>');
myMail.setSenderDisplayName('Salesforce Support');
myMail.setSubject('An email from Salesforce');
myMail.setPlainTextBody('This email has been sent through Apex');
myMail.setHtmlBody('<p>This email has been sent through Apex.</p>');

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { myMail });
System.debug(userEmail);
}
}

Now, on to sending!

Mailtrap Email Sending is a solution that offers both an API and an SMTP service for delivering emails at an average time of ~1 second. Its setup is smooth as well as secure, and you don’t need to fill out lengthy forms or provide a lot of validation credentials in the process. 

Users of the sending solution get access to unique monitoring features for staying on top of deliverability numbers and troubleshooting unexpected sending issues quickly and easily. These features include:

To use Mailtrap’s email-sending solution in Salesforce, after singing up for your Mailtrap account, you will have to add and verify a domain as described in the video below:

After that, you can find the necessary credentials for adding the relay by navigating to Sending Domains → Choosing a domain → SMTP/API Settings.

The steps for adding the email relay will remain the same, so feel free to follow what we described for the email-testing solution in the section right above this one.

Once all the steps are complete, you can send a test email to verify that you have configured everything correctly. To do so, use the following Apex code snippet with any necessary modifications made beforehand.

public with sharing class MailTrapEmailApi {
public static void sendMail(){
String body = '<your body>';

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://send.api.mailtrap.io/api/send');
request.setMethod('POST');
request.setHeader('Api-Token', '<yourMailtrapAPIToken>');
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
request.setBody(body);
System.debug('1 ' + request);
HttpResponse response = http.send(request);
System.debug('2 ' + response);
}

Best practices to avoid triggering spam filters 

Polish the email content and structure 

Content is by far the most important element of an email – it’s what delivers your message, provides value to the reader, and encourages clicks of your CTAs. That being said, it’s crucially important that this content doesn’t come off as spammy by containing overly promotional words, links with bad reputations, or irrelevant attachments. 

Just as important is having subject lines that match the content and are not misleading, and, of course, are completely free of spammy language.

Once you make sure your content and subject lines will not trigger spam filters, you should also make sure your content is truly valuable to the recipients so they don’t manually send your message to the spam email folder.

The other content-related tips to keep in mind include:

Monitor and improve your sender reputation 

Email sender reputation is an indicator of how trustworthy and credible an email sender is based on their past sending behavior. It’s also a factor email providers take very seriously when deciding how incoming emails from that sender will be treated. 

By combining your IP reputation and domain reputation, the sender reputation can be determined. But what affects how good or bad the sender reputation will be? A few things:

Some effective ways to improve your sender reputation include authenticating your domain, growing the email subscribers list organically, cleaning your email subscribers list regularly, boosting engagement, and so on. 

We cover the topic in detail in our email sender reputation article.

Modify your “from” name 

Reviving an email from a sender with a very generic name can, in some cases, cause some confusion and mistrust in the minds of the recipients. For that reason, it’s very smart to change your from or sender name into something more professional, thus avoiding the situation where your email address looks like spam.

So, for instance, instead of “outreach@comany.com” you can go with “john@company.com”. This will make the recipients feel like the email was sent by an actual person and not a bot, making them more keen to open and read it and, of course, less likely to send it to spam.

Spot potential trap email addresses 

To catch spammers, bots, and other malicious actors, ESPs might resort to using trap email addresses. If you contact these addresses via email, you will get blacklisted, and in turn, your emails will be automatically sent to a recipient’s spam folder. 

You can avoid this scenario by resorting to the use of software and techniques intended to identify trap email addresses.

Enable easy unsubscribing 

You don’t want to be bombarded by emails you find irrelevant, and neither do your email list subscribers. That is why unsubscribing from the emails you send should be an accessible and simple process.

If this isn’t the case, you risk getting marked as a spammer and potentially even breaking email-sending laws and regulations.

Stay off of blacklists 

Earlier in the article, we explained the consequences of being blacklisted by ESPs. Taking that into consideration, you have to put serious effort into avoiding getting blacklisted, as well as thoroughly checking the most popular blacklists for your sender IP or domain. 

In the unfortunate event that you end up on one of the infamous lists, you’ll need to rethink your sending practices.

Don’t use purchased email lists 

Although it might seem like a great way to reach lots of people fast, using a purchased email list is the fastest way to tank your domain reputation and get the spammer label attached to you.

So, instead of doing this, take your time to build a quality email list and make sure you use a double opt-in so people who sign up to receive emails from you/your business are truly interested in that.

Keep your emails out of the spam club 

Salesforce email going to spam is a nightmare for anyone in charge of sending out communication using this popular CRM. Luckily, there are plenty of tips to try which can help your emails land in the inbox and not the spam folder. 

In this article, we listed the most effective tips, so study them well and start by implementing the ones that might create the biggest change in your email performance!

Exit mobile version