Hari ini mau tulis tentang javamail, yakni mengirim file menggunakan javamail. Oke di postingan kemarin sudah dibahas sedikit mengenai javamail. Dan postingan kali ini dengan tambahan file yang akan dikirim. Langsung saja ke kode.
import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.mail.Authenticator;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
/**
*
* @author user
*/
public class SendFileEmail {
public static void main(String[] args) {
SendFileEmail sf = new SendFileEmail();
sf.excute();
}
/**
*
* @author user
*/
public class SendFileEmail {
public static void main(String[] args) {
SendFileEmail sf = new SendFileEmail();
sf.excute();
}