0

I am using Mailgun as my service provider. Here, I have a java code to send mails to my clients through mailgun. I have created a file path to my html file. I need to execute it in my client side mail as template. How to achieve this through my following coding???

    public static ClientResponse SendSimpleMessage()
     {
           Path p4 = FileSystems.getDefault().getPath("c:\\software\\k3.html");
           Client client = Client.create();
           client.addFilter(new HTTPBasicAuthFilter("api","key-*****"));
           com.sun.jersey.api.client.WebResource webResource 
                   =client.resource("https://api.mailgun.net/v2/****/messages");
           MultivaluedMapImpl formData = new MultivaluedMapImpl();
           formData.add("from", "*****r@outlook.com");
           formData.add("to", "***@gmail.com");
           formData.add("subject", "Creating Mailing List");
           formData.add("text", "Mailing List was created successfully");
           formData.add("html",p4.toUri());
           return webResource.post(ClientResponse.class,formData);  
    }

I have doubt in the "p4.toURI()" statement. Kindly help me.....

kalyan
  • 39
  • 2
  • 4
  • What do you expect `p4.toUri()` to do? Have you read the `toUri()` documentation? – tucuxi Aug 28 '14 at 16:10
  • Yes, I have received only absolute url in my client side. I need your suggestion about " what is the substitution statement that can be used for executing my html file in the client side?". – kalyan Aug 28 '14 at 16:13
  • What do you mean by "execute HTML file"? As far as I know, HTML can't be "executed". – Étienne Miret Aug 28 '14 at 16:41
  • I need to send an email template to my client through mailgun. Sorry for using word "executing". Kindly guide me on this issue... – kalyan Aug 28 '14 at 16:51

0 Answers0