public class OAMail extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
OAMail.OAMailAttachment |
Constructor and Description |
---|
OAMail(String host,
int port,
String user,
String pw) |
OAMail(String host,
String user,
String pw)
Used to send emails.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getUsesSSL() |
boolean |
isValidEmailAddress(String email) |
static void |
main(String[] args) |
static void |
mainAaa(String[] args) |
static void |
mainB(String[] args) |
void |
sendSmtp(String[] to,
String[] cc,
String from,
String subject,
String text,
String contentType) |
void |
sendSmtp(String[] to,
String[] cc,
String from,
String subject,
String text,
String contentType,
byte[] bsAttachment,
String mimeTypeBs,
String bsFileName) |
void |
sendSmtp(String[] to,
String[] cc,
String from,
String subject,
String text,
String contentType,
String[] fileNames) |
void |
sendSmtp(String[] to,
String[] cc,
String from,
String subject,
String text,
String contentType,
String[] fileNames,
byte[] bsAttachment,
String mimeTypeBs,
String bsFileName) |
void |
sendSmtp(String[] to,
String[] cc,
String from,
String subject,
String text,
String contentType,
String[] fileNames,
OAMail.OAMailAttachment[] attachments) |
void |
sendSmtp(String to,
String cc,
String from,
String subject,
String text,
String contentType,
byte[] bsAttachment,
String mimeTypeBs,
String bsFileName) |
void |
sendSmtp(String to,
String cc,
String from,
String subject,
String text,
String contentType,
String[] fileNames) |
void |
setDebug(boolean b) |
void |
setUseSSL(boolean b) |
public OAMail(String host, String user, String pw)
host
- port
- if < 1, then it will use default 25user
- user id for mail serverpw
- user password for mail serverpublic void setUseSSL(boolean b)
public boolean getUsesSSL()
public void setDebug(boolean b)
public void sendSmtp(String to, String cc, String from, String subject, String text, String contentType, String[] fileNames) throws Exception
Exception
public void sendSmtp(String to, String cc, String from, String subject, String text, String contentType, byte[] bsAttachment, String mimeTypeBs, String bsFileName) throws Exception
Exception
public void sendSmtp(String[] to, String[] cc, String from, String subject, String text, String contentType, String[] fileNames) throws Exception
to
- cc
- from
- subject
- text
- contentType
- if null or blank, then will default to "text/html; charset=UTF-8"
, others: "text/html", "text/plain", "text/richtext", "text/css", "image/gif"fileNames
- Exception
public void sendSmtp(String[] to, String[] cc, String from, String subject, String text, String contentType) throws Exception
Exception
public void sendSmtp(String[] to, String[] cc, String from, String subject, String text, String contentType, byte[] bsAttachment, String mimeTypeBs, String bsFileName) throws Exception
Exception
public void sendSmtp(String[] to, String[] cc, String from, String subject, String text, String contentType, String[] fileNames, byte[] bsAttachment, String mimeTypeBs, String bsFileName) throws Exception
Exception
public void sendSmtp(String[] to, String[] cc, String from, String subject, String text, String contentType, String[] fileNames, OAMail.OAMailAttachment[] attachments) throws Exception
Exception
public boolean isValidEmailAddress(String email)
Copyright © 1999–2019 ViaOA. All rights reserved.