cancel
Showing results for 
Search instead for 
Did you mean: 

Email Sending - Web Dynpro java

Former Member
0 Kudos

Hi All ,

When we want to send Emails through Web Dynpro java application , what are the necessary or prilimanry things needed ?

1 ) In my application , jar files are there ( activation and mail )

When deployed and run it is giving no errors but mails are not going .

Secondly , from portal ( abap stack ) sap inbox when i send message to any company mail id , it is going

That is SMTP in portal is configured .

I could not understand , why it is not going from Portal ?

Also Do I need any configuration / setttings in

1) Config tool

2) Visual Adminstrator

3) Sys Adm - Sys config - UME - Emails notification

and SYstem

Regards,

Suray

Accepted Solutions (0)

Answers (2)

Answers (2)

siddharth_jain
Active Contributor
0 Kudos

Hi,

You can refer this thread as well:

Hope this Help.

Regards,

Siddharth

Former Member
0 Kudos

Dear Suresh and Siddarth ,

I am not asking any code or code errors or deployment problems.

I am asking that , after even deployed application successfully , Mails or not going .

I would like to know any settings needed to be done ........????/

Regards,

surya

Former Member
0 Kudos

Hi,

check ur SMTP IP address.

Former Member
0 Kudos

HI,

The IP address is correct which I have mentioned in my application . ( smtp host)

Any thing else I need to check .

Regards,

Surya

Former Member
0 Kudos

Hi Surya

Please look into the [Blog|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8667] [original link is broken] [original link is broken] [original link is broken]; , just for your reference

Best Regards

Chaitanya.A

Former Member
0 Kudos
Former Member
0 Kudos

Thanks all.

sureshmandalapu6
Active Contributor
0 Kudos

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

}

Thanks

Suresh