Sending an email message |
To send an email message first establish a connection to the SMTP server and then invoke the Smtp#send method passing an com.jscape.inet.email.EmailMessage instance as an argument.
Example
// establish connection Smtp smtp = new Smtp("smtp.myserver.com"); smtp.connect();
// build message EmailMessage message = new EmailMessage("jsmith@myserver.com","mjones@yourserver.com"); message.setSubject("Meeting today at 2:30 p.m."); message.setBody("See you then");
// send message smtp.send(message);
// release connection smtp.disconnect();
See also
|