View RSS Feed

Java Mail

Java Mail API Message

Rate this Entry
by , 04-25-2012 at 09:51 PM (848 Views)
When session object has been created, message is created so that to send it by the help of Message class. As message class is considered as abstract class hence subclass javax.mail.internet.MimeMessage will be used.
Java Code:
MimeMessage message = new MimeMessage(session) 
// set the content of message by setContent() method
message.setContent(“[url]www.xyz.net”[/url], “text/plain”);
setText() method can also be used to set the content.
Java Code:
Message.setText(“[url]www.xyz.net”);[/url]
Use setSubject() method for creating subject line to send messages.
Java Code:
Message.setSubject(“Its Urgent Message”);

Submit "Java Mail API Message" to Facebook Submit "Java Mail API Message" to Digg Submit "Java Mail API Message" to del.icio.us Submit "Java Mail API Message" to StumbleUpon Submit "Java Mail API Message" to Google

Categories
Mail API

Comments