cancel
Showing results for 
Search instead for 
Did you mean: 

Send Email from Web Dynpro

Former Member
0 Kudos

Hello,

I'm trying to send an email from a web dynpro form, I already add the mail.jar (javamail-1.4.3) to the java build path of the project and I add the recommended code in all forums. The project is fine an I don't have compile errors.

The problem is when I "deploy and run", during the build, all the classes corresponding to the javamail library shows me error.

" [javac] Compiling 14 source files to C:\NWDSWS.jdi\LocalDevelopment\t\6D663493A729F892D2F000D69576C24B\classes

[javac] ERROR: C:\NWDSWS.jdi\LocalDevelopment\t\6D663493A729F892D2F000D69576C24B\gen_wdp\packages\pe\com\minsur\wd_mail_v1\mailtestapp\comp\MailTestCompView.java:21: package javax.mail does not exist

[javac] ERROR: import javax.mail.*;

[javac] ERROR: ^

[javac] ERROR: C:\NWDSWS.jdi\LocalDevelopment\t\6D663493A729F892D2F000D69576C24B\gen_wdp\packages\pe\com\minsur\wd_mail_v1\mailtestapp\comp\MailTestCompView.java:22: package javax.mail.internet does not exist

[javac] ERROR: import javax.mail.internet.*;

[javac] ERROR: ^"

So the form display and it doesnt do anything.

What I have to do? I have to deploy first the javamail.jar to the WAS before this? How can I do that?

Regards

SU

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi soauniverse,

please can you share the step us did to accomplish sending email from webdynpro form?

What approach did you use? I know there is a SendMailAsynch class and also the javax.mail.Transport route...

Whats the best way can you share a code snippet of sending the email?

Former Member
0 Kudos

Hello,

The best way is to add to the DC of the Web Dynpro the mail library that SAP brings with the developer studio. Right clic of your web dynpro project->Development Component->Show in->Component Properties, then dependencies, select Add, and choose from SERVERCORE, activation and mail. Select Deploy Time and Runtime.

You can find a good example of the source code in this article,

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/40239f38-a94a-2b10-c583-9b89187c3856

you can also see this blogs,

/people/bertram.ganz/blog/2008/11/24/how-to-use-external-jar-files-in-web-dynpro-development-components

/people/raphael.vogel/blog/2008/05/05/how-to-use-external-libraries-in-the-sap-component-model-part-i

/people/raphael.vogel/blog/2008/05/05/how-to-use-external-libraries-in-the-sap-component-model-part-ii

Thanks

Regards

SU

Former Member
0 Kudos

This is the solution,

/people/bertram.ganz/blog/2008/11/24/how-to-use-external-jar-files-in-web-dynpro-development-components

SU