|
|
SMTP Information for sending mail using JMailWhen using JavaMail, set the SMTP host to: localhost; Below is a code example of sending email via Java application: Message mailMsg; <%@ page import="javax.mail.*,javax.mail.internet.*,java.util.*" %> <% Properties props = new java.util.Properties(); mailMsg = new MimeMessage(s); InternetAddress fromAddress = new InternetAddress("support@netregistry.com.au"); String mto[] = new String[1]; InternetAddress[] toAddress = new InternetAddress[mto.length]; for (int i = 0; i < mto.length; i++) mailMsg.setFrom(fromAddress); mailMsg.setSentDate(new java.util.Date()); StringBuffer sb = new StringBuffer().append("hello"); // set the body // send the email |