Hello, Gurus,
How to can I send data for instance name, address, phone, mobile, etc., to e-mail from java webdynpro?
Thank you for your hurry answers.
Anderson.
a simple search in SDN will give tons of answer
Hi Alejandro,
You can use Java Mail in Web Dynpro for sending e-mail to user.
Check this article to understand this concept:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/40239f38-a94a-2b10-c583-9b89187c3856
In the messge part of your mail, you can put the desired information.
e.g. String sid = System.getProperty("SAPSYSTEMNAME"); // Instance Name
Properties props = new Properties();
props.put("mail.smtp.host", "my-mail-server");
props.put("mail.from", "sender-mail -id");
Session session = Session.getInstance(props, null);
try {
MimeMessage msg = new MimeMessage(session);
msg.setFrom();
msg.setRecipients(Message.RecipientType.TO,"receiver-mail-id");
msg.setSubject("mail-subject");
msg.setSentDate(new Date());
msg.setText("SAP Instance name:"+sid);
Transport.send(msg);
} catch (MessagingException mex)
{
System.out.println("send failed, exception: " + mex);
}
Thanks
Gautam Singh
Thank you Gautam.