How to Avoid Outlook / Hotmail Spam with Mailgun?

I am using Mailgun to send transactional emails (tickets for events) and all emails are sent to Outlook / Hotmail spam and I want to avoid this. I added SPF and DKIM records and nothing works. What to do to avoid the spam filter (actually, I am not sending spam. The user triggers a transactional email when he registers for an event)

Client client = Client.create ();
client.addFilter ( new HTTPBasicAuthFilter ( "api", "MI_API_KEY" ) );
WebResource webResource = client
        .resource ( "MAILGUN_URL" );

MultivaluedMapImpl formData = new MultivaluedMapImpl();

formData.add ( "from", "hola@peewah.co" );
formData.add ( "to", "csacanam@outlook.com" );
formData.add ( "subject", "Camilo, welcome to the event" );
formData.add ( "html", "<h1>Camilo thank you for your registration in the event</h1>") );
formData.add ( "text", "Camilo thank you for your registration in the event" );

ClientResponse clientResponse = webResource.type ( MediaType.APPLICATION_FORM_URLENCODED )
        .post ( ClientResponse.class, formData );

int status = clientResponse.getStatus ();

if ( status >= 400 )
{
    throw new BadRequestException ( "Your message couldn't be sent" );
}

      

+5


source to share


2 answers


Your problem is not your code, it is a problem using MailGun. If you check the email headers with the following site:

https://testconnectivity.microsoft.com/?tabid=mha

You will see something similar to the following:

Spam Confidence Level   5 (Spam Confidence Interpretation - Spam)

Bulk Complaint Level    6 (Bulk Complaint Level - The message is from a bulk sender that generates a mixed number of complaints.)

      

The problem is that the MS is considering anything from the generic MG IP coming from the bulk sender, which affects the SPL and could raise it to 5 or higher (spam).

How can I find out? I have the same problem. I think the only option would be to switch to a private IP, but our sending volume isn't high enough, so it looks like we've spent a lot of time and effort on MG!



Does anyone know of another sender who avoids Hotmail spam?


Ok, this is an update just in case it helps anyone. We finally managed to get delivery to Outlook from MailGun, this is what we checked / fixed etc, hope this helps:

  • The address requires name@mg.yourdomain.com, not name@yourdomain.com (seems obvious now, we missed that
  • Add header h: List-Unsubscribe and use <% unsubscribe_url%> to replace unsubscribe link
  • Check your SPF. When adding MailGun SPF, our provider added an additional invalid SPF record automatically, apparently you can have one SPF for each subdomain
  • Make sure the links in your link to content in your domain
  • Make sure branding is relevant and links to your domain.
  • Make sure you have a free subscription message. First we just text link that says "unsubscribe", we changed that to "Click here to unsubscribe if you no longer want to receive our emails"

It is of course worth checking the headers https://testconnectivity.microsoft.com/?tabid=mha This will give you leverage when MG disconnects an IP with a bad reputation.

+12


source


I also ran into this problem recently - I highly recommend you contact Mailgun support and notify them of the problem. They found out that the IP address I was at was associated with a user who was sending a lot of spam and connected us to a "clean" IP address. My guess is that if you delete your IP and they will automatically assign you a new one, it might work, but it might not be a guaranteed fix if the new IP is blacklisted as well - just let them know, they'll help you.



0


source







All Articles