on 08-18-2008 7:42 AM
I am working on a application which sends mails between users.
i have put all the coding for this mailing in session bean.I have then created the webservice and deployed it on j2ee engine.
Can someone tell me that while i test my WebService, is it necessary that the mails should be sent while i test my WebServ??
ALSO PLZ TELL ME DO I NEED TO DEPLOY MAIL.JAR AND ACTIVATION.JAR FILES ON THE J2EE ENGINE??
do they need to be included in the project ??
Plz reply
Thanx in advance
hi,
go thru this article its perfectly descibes the steps required to develop an mail application in webdynpro..
Using JavaMail in Web Dynpro Java Applications for Sending e-mail to Multiple Users
regards
Nikhil tapkir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sry
posted at the wrong thread
Edited by: Nikhil Tapkir on Aug 20, 2008 6:28 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Add activation.jar and mail.jar file to your ejb project and then build archive of ejb and then build application archive and deploy that EAR to j2ee engine.
Abhilasha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Add activation.jar and mail.jar file to your ejb project and then build archive of ejb and then build application archive and deploy that EAR to j2ee engine.
Abhilasha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pankaj,
As u askd mail should b sent during testing of web service as its functioning for mail sending only.
Yeah you'll have to deploy .jar file first then u need to deply .Ear file of Enterprise application project..
After deployment of .Ear file, Test ur web service.
If ur application is wrking is fine ,mail shud b sent .
hope this will help you.
Regards,
Khushboo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi pankaj mathur ,
refer the following links
http://help.sap.com/erp2005_ehp_03/helpdata/EN/8d/6bd83e8cb23d67e10000000a114084/frameset.htm
https://forums.sdn.sap.com/click.jspa?searchID=1063990&messageID=1486766
http://hc.apache.org/httpclient-3.x/methods/post.html
But if you don't need its, maybe this link can post can help you.
Code
try
{
String strSMTPIPAddress ="192.168.100.103";
Properties props;
Session session;
Provider p;
props = System.getProperties();
props.put("mail.smtp.host", strSMTPIPAddress);
session = Session.getDefaultInstance(props, null);
StringBuffer strMailBody = new StringBuffer();
wdThis.createmailbody(strMailBody);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("<give the email address here>"));
message.addRecipient(Message.RecipientType.TO, new InternetAddress("<email address>"));
message.setSubject("<give the subject of mail>");
MimeMultipart mimemultipart = new MimeMultipart();
// //set message content
//this is body content
MimeBodyPart mimebodypart1=new MimeBodyPart();
//This is attachmnent
MimeBodyPart mimebodypart2=new MimeBodyPart();
// mimebodypart1.setText("xxx"); //Attachment
mimebodypart2.setText("<give the content of attachemnt>');
mimemultipart.addBodyPart(mimebodypart1);
mimemultipart.addBodyPart(mimebodypart2);
//message.setText(wdContext.currentContextElement().getSalorder());
message.setContent(mimemultipart);
message.setText(strMailBody.toString());
Transport.send(message);
wdComponentAPI.getMessageManager().reportSuccess("E-mail is sent to sharanya");
}
catch (Exception e)
{
wdComponentAPI.getMessageManager().raiseException("Exception" + e.getMessage(), true);
}
points if useful
thanks
suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Q1. is it necessary that the mails should be sent while i test my WebServ??
Ans: Yes, If Web Service is working fine, it should send mail while testing too.
Q2. PLZ TELL ME DO I NEED TO DEPLOY MAIL.JAR AND ACTIVATION.JAR FILES ON THE J2EE ENGINE??
Ans : If you are using DC, u have to add activation and mail from in Used DCs - > SA-JEE.
Hope I answered your questions correctly
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.