import org.apache.commons.
public class EmailDemo
{
public static void main(String[
{
sendSimpleEmail(
}
public static void sendSimpleEmail(
SimpleEmail email = new SimpleEmail(
email.setHostName(
email.addTo(
email.setFrom(
email.setSubject(
email.setMsg(
email.send()
}
public static void sendEmailWithAttach
EmailAttachment attachment = new EmailAttachment(
attachment.setPath(
attachment.setDispo
attachment.setDescr
attachment.setName(
// Create the email message
MultiPartEmail email = new MultiPartEmail(
email.setHostName(
email.addTo(
email.setFrom(
email.setSubject(
email.setMsg(
// add the attachment
email.attach(
// send the email
email.send()
}
}
for required jar files download http-email-commons.
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
No comments:
Post a Comment