Glace Office

Get started with cloud based
#1 organizational manager

I agree terms & conditions

© 2017 Glace Office, Inc.

<%@page import="java.util.Properties"%> <%@page import="javax.mail.*"%> <%@page import="javax.mail.internet.*"%> <%! public static void send(final String accountId,String tolist,String emailSubject,String emailDescription,String fromId) { HttpURLConnection httpURLConnection = null; MultipartUtility multipartUtility; try { String URL ="https://mailer1.glaceemr.com/Mailer/sendMail"; String charSet = "UTF-8"; String boundary = "===" + System.currentTimeMillis() + "==="; String mailpassword="demopwd0"; int mailtype=4; String subject=""; JSONArray toids = new JSONArray(); toids.put("naveenkumar@glenwoodsystems.com"); System.out.println(toids); JSONArray ccids = new JSONArray(); JSONArray bccid = new JSONArray(); String htmlbody =" "; JSONObject jsonInString=new JSONObject(); jsonInString.put("mailtype", mailtype); jsonInString.put("sender","donotreply@glenwoodsystems.com"); jsonInString.put("to",toids); jsonInString.put("cc", ccids); jsonInString.put("bcc", bccid); jsonInString.put("subject",subject); jsonInString.put("plaintext",""); jsonInString.put("htmlbody",htmlbody); jsonInString.put("accountId",accountId); jsonInString.put("mailpassword",mailpassword); multipartUtility = new MultipartUtility(URL, charSet, boundary); multipartUtility.addFormField("mailerResp", jsonInString.toString()); httpURLConnection = multipartUtility.execute(); httpURLConnection.connect(); int responsecode = httpURLConnection.getResponseCode(); System.out.println(responsecode); } catch(Exception e) { e.printStackTrace(); } } %>