Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- Process p = Runtime.getRuntime().exec(new String[]{
- "/usr/sbin/sendmail",
- "-t"
- });
- try (OutputStreamWriter os = new OutputStreamWriter(p.getOutputStream(), "UTF8")) {
- os.write("Content-Type: text/html\n");
- os.write("From: abc@gmail.com\n");
- os.write("To: abc@gmail.com\n");
- os.write("CC: abc@gmail.com\n");
- os.write("BCC: abc@gmail.com, abcd@gmail.com\n");
- os.write("Subject: This is subject\n");
- os.write("\n");
- os.write("Dear \n");
- os.write("This is just a example \n");
- }
- p.waitFor();
- } catch (IOException | InterruptedException e) {
- log.error(null, e);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement