cancel
Showing results for 
Search instead for 
Did you mean: 

Mailing on Webdynpro

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40239f38-a94a-2b10-c583-9b89187c...

regards

Nikhil tapkir

Answers (6)

Answers (6)

Former Member
0 Kudos

sry

posted at the wrong thread

Edited by: Nikhil Tapkir on Aug 20, 2008 6:28 AM

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

sureshmandalapu6
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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