on 10-23-2008 1:14 PM
Hi Friends,
Is it possible to implement Mailing Concept in WebDynPro?
If so how this can be done?
An e-mail has to be sent on click.
Please help me out in this regard.
Thanks and regards,
Chandrashekar.
Hello,
You can use the below JAVA function for sending mail through a SMTP server.
import javax.mail.Address;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.MimeMessage;
import javax.naming.InitialContext;
/**
To send a mail thru some smtp server
*/
public static void sendSMTPMail(Address addresses[], String subject, String content) {
InitialContext ctx = new InitialContext();
Transport mailTransport = null;
try {
Session sess = (Session) javax.rmi.PortableRemoteObject.narrow(ctx.lookup("java:comp/env/mail/MailSession"), Session.class);
Message msg = new MimeMessage(sess);
msg.setFrom(addresses[1]);
msg.setRecipient(Message.RecipientType.TO, addresses[0]);
msg.setSubject(subject);
msg.setContent(content, "text/html");
msg.setSentDate(new GregorianCalendar().getTime());
msg.saveChanges();
String SMTPIP = "SMTP_IP";
String SMTPPORT = "SMTP_PORT";
mailTransport = sess.getTransport("smtp");
mailTransport.connect(SMTPIP, SMTPPORT, "");
Address[] address = msg.getAllRecipients();
mailTransport.sendMessage(msg, address);
} catch(Exception smtpMailException){
throw new Exception(smtpMailException);
} finally {
if(mailTransport != null){
mailTransport.close();
}
}
}
Regards,
Smita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chandrashekhar
Please go through this link
Regards
Ruturaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Following links may help you.
http://help.sap.com/erp2005_ehp_03/helpdata/EN/8d/6bd83e8cb23d67e10000000a114084/frameset.htm
Very useful link:
I hope if you go through these links your problem will definately be solved.
Thanx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cahndrashekhar,
Check out the following links for accessing the Java Mail API through Web Dynpro:
Best Regards,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes its possible there is no difference in Webdynpro
You have to use the Java mail API's
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.