Skip to content

Commit 18cd197

Browse files
committed
SMTP : add new data() method that will convert html to text
1 parent 5579ed6 commit 18cd197

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/javaforce/SMTP.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,16 @@ public boolean data(String body_text, String body_html, Attachment[] attachments
396396
return true;
397397
}
398398

399+
/** Sends an enhanced message in html format with headers and optional attachments.
400+
* Text message is generated automatically.
401+
*
402+
* @param html = body of message in HTML format
403+
* @param attachments = files to attach
404+
*/
405+
public boolean data(String body_html, Attachment[] attachments) throws Exception {
406+
return data(HTML.toText(body_html), body_html, attachments);
407+
}
408+
399409
private void getResponse() throws Exception {
400410
ArrayList<String> tmp = new ArrayList<String>();
401411
String str;

0 commit comments

Comments
 (0)