on 08-09-2005 8:27 AM
Hi,
I'am new in that business and have a simple question:
What is the easiest way to send emails from a web dynpro application to a specific (e.g. value of an input field in my application).
The only way I found was the "email - web service tutorial in the pdk).
Can anyone give me some code to solve this problem.
Thanx
christoph
hi,
How abt this .
InitialContext ctx = new InitialContext();
Properties props = new Properties();
props.put("mail.smtp.host","msg server");
Session sess = Session.getInstance(props);
//Create new mime message object
Message message = new MimeMessage(sess);
message.setFrom(new InternetAddress(from email));
String recepient = wdContext.currentContextElement().getTo();
message.setRecipient(Message.RecipientType.TO,new InternetAddress(to email));
message.setSubject(subject);
message.setContent(content,"text/plain");
//Send the message
Transport.send(message);
Regards
Bharathwaj
Message was edited by: Bharathwaj R,Error corrected.Check my next post also!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Sorry ! One sec! I will edit it and do it again !
InitialContext ctx = new InitialContext();
Properties props = new Properties();
props.put("mail.smtp.host","Message server");
Session sess = Session.getInstance(props);
//Create new mime message object
Message message = new MimeMessage(sess);
message.setFrom(new InternetAddress(wdContext.currentContextElement().getFrom()));
String recepient = wdContext.currentContextElement().getTo();
message.setRecipient(Message.RecipientType.TO, new InternetAddress(recepient));
String subject = wdContext.currentContextElement().getSubject();
message.setSubject(subject);
String content = wdContext.currentContextElement().getMessage();
message.setContent(content,"text/plain");
//Send the message
Transport.send(message);
This should work.. (Some editing error while i was pasting it !)
Message was edited by: Bharathwaj R
Hi,
Syntax is
InternetAddress[] Toaddress = new InternetAddress[Number];
msg.setRecipients(MimeMessage.RecipientType.TO, Toaddress);
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christoph,
Check out this weblog:
/people/renald.wittwer/blog/2005/01/05/develop-a-web-service-that-sends-an-email
Regards,
Pooja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
there are number of options available, like you can use the java mail framework to create your own mail service and you can use that, or if you have your own mail service configured (like outlook webaccess) you use that too.
regards,
rahul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Easiest way is
1.Create Link to URL
2.create a contextarrtib "reference" and set the reference and text property of linktoURL to this attribute.
3.use this statement in the init method.
wdContext.currentContextElement().setReference("mailto:<EMailID>");
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
is it not really good for you https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web dynpro tutorial and sample applications.faq#q-6 ?
Regards, Maksim R.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.