attachment.setDisposition(EmailAttachment.ATTACHMENT);
attachment.setDescription("Apache logo");
attachment.setName("Apache_logo.gif");
// Create the email message
MultiPartEmail email = new MultiPartEmail();
email.setDebug(true);
// Set email host
email.setHostName("10.7.2.18");
// email.setAuthentication("nice_to_meet", "asf_logo_me");
// email.setSSL(true);
// Set email from
email.setFrom("lei.gao@renren-inc.com", "Commons Email");
email.setBounceAddress("lei.gao@renren-inc.com");
// Set email content
email.addTo("jiyun.xie@renren-inc.com", "Jiyun Xie");
email.addTo("lei.gao@renren-inc.com", "Lei Gao");
email.setSubject("Foll Alert The Git test");
email.setMsg("Here is Apache's logo, please enjoy it!");
// add the attachment
email.attach(attachment);
// send the email
email.send();
}