I'm using Mailgun to send transactional emails (tickets for events) and all the emails are sent to Outlook/Hotmail spam and I want to avoid that. I have added the SPF and DKIM records and nothing works. What should I do to avoid the spam filter (actually, I'm not sending spam. The user triggers the transactional email when he register to 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" );
}