Skip to main content

Posts

Featured

Send Email using JAVA

Here I post code for send email using JAVA. first create package test.mail and create following two classes. SendMail  class package test.mail; import java.net.InetAddress; import java.net.MalformedURLException; import java.net.URL; import java.net.UnknownHostException; import java.util.Date; import java.util.Properties; import javax.activation.DataHandler; import javax.activation.URLDataSource; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.Session; import javax.mail.Transport; import javax.mail.Message.RecipientType; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; public class SendMail { private String from; private String to; private String subject; private String text; public SendMail(String from, String

Latest Posts

Run command line argument through java code

Scan your computer for ports in use

Port scan on a remote machine