mercoledì 4 novembre 2009

Create java email Template

// Grab the email template. 
InputStream template = 
getServlet() 
.getServletConfig() 
.getServletContext() 
.getResourceAsStream( 
"/WEB-INF/email/registrationNotification.xml"); 

EmailTemplate notification = EmailTemplate.getEmailTemplate(template); 

// Create the section of the email containing the actual user data. 
String[] args = { "Rafe" }; 

EmailSender.sendEmail("mail@mail.com", notification, args);
in riferimento a:
"// Grab the email template. InputStream template = getServlet() .getServletConfig() .getServletContext() .getResourceAsStream( "/WEB-INF/email/registrationNotification.xml"); EmailTemplate notification = EmailTemplate.getEmailTemplate(template); // Create the section of the email containing the actual user data. String[] args = { "Rafe" }; EmailSender.sendEmail("rafe@rafe.us", notification, args);"
- Creating Email Templates with XML - O'Reilly Media (visualizza su Google Sidewiki)

Nessun commento:

Posta un commento