on 2010 Jun 16 6:54 AM
Hi Experts,
I have created the Email callable object and then created e-mail template using HTML Template then assigned to email callable object. In that E-mail template I can change the content dynamically but I am not able to change the subject line dynamically. Is it possible to change subject line dynamically based on action in e-mail template using e-mail callable object.
Please guide me.
Thanks & Regards,
Sundaresan.B
hi
why you are creating the callable object, you can simply send the mail at the end of execute method using this code;
public void sendMailtoHR( )
{
//@@begin sendmail()
try
{
String strSMTPIPAddress ="152.63.1.200";
Properties props;
Session session;
Provider p;
props = System.getProperties();
props.put("mail.smtp.host", strSMTPIPAddress);
session = Session.getDefaultInstance(props, null);
p = session.getProvider("smtp");
strMailBody = new StringBuffer();
generateMailbody(strMailBody);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("mailid"));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(mailid));
message.setSubject("Employee Resignation Request");
message.setText(strMailBody.toString());
Transport.send(message);
}//try
catch (Exception e)
{
wdComponentAPI.getMessageManager().raiseException("Exception in sendmail" + e.getMessage(), true);
}
//@@end
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.