Skip to Content
avatar image
Former Member

Mailing on Webdynpro

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 18, 2008 at 07:04 AM

    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-9b89187c3856

    regards

    Nikhil tapkir

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2008 at 07:54 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2008 at 10:38 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 18, 2008 at 08:22 AM

    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

    sending-email-from-web-dynpro

    Send Email in webdynpro for java

    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.

    How to send data from Web dynpro App to JSP or vice versa

    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(" "));

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 19, 2008 at 09:47 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 19, 2008 at 09:48 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2008 at 04:28 AM

    sry

    posted at the wrong thread

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

    Add comment
    10|10000 characters needed characters exceeded