Created
May 23, 2017 08:04
-
-
Save kalvian1060/b584c62e7924a49de25865a584cb37f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ClientResponse SendEmailGun(String to) { | |
WebResource webresource = null; | |
MultivaluedMapImpl formData = new MultivaluedMapImpl(); | |
try { | |
Client client = Client.create(); | |
client.addFilter(new HTTPBasicAuthFilter("api", MAILGUN_API_KEY)); | |
webresource = client.resource(MAILGUN_HOST + "/messages"); | |
formData.add("from", "Excited User <[email protected]> "); | |
formData.add("to", to); | |
formData.add("subject", "Struk Belanja Anda"); | |
formData.add("text", "Testing PIN ADMOB"); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
return webresource.type(MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class, formData); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment