網上找了很多關於javamail發送會議請求的文章,終於成功了,沒有使用ical4j,發送的outlook直接打開就是一個會議請求,而不是以附件的形式存在。具體的注意點在代碼中以注釋的形式標明。
DESCRIPTION中如果想換行,換行符為:=0D=0A
關於icalendar的規范,請看:https://rsync.tools.ietf.org/html/rfc5545
public class Email {
private static String EMAIL_CONFIG = "email_config.properties";
private Properties emailProp = new Properties();
public Email() {
InputStream is = getClass().getResourceAsStream("/"+EMAIL_CONFIG);
try {
emailProp.load(is);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private class EmailAuthenticator extends Authenticator {
protected PasswordAuthentication getPasswordAuthentication() {
String userId = emailProp.