Skip to Content
0
Sep 15, 2005 at 01:44 PM

Sending Mail with attachment from WD

34 Views

Hi all,

I wan't to send an email from webdynpro with an attached pdf-document. I had a look at Tutorial 31, but i will only use the first part, sending email with attached interactive form. So I decided to build a new project. I did everything as in the tutorial described, but when entering the following code into the wdDoInit method from the SendView an error occurs.

//@@begin wdDoInit()

// @TODO Enter your email address for the setFrom and setTo methods by replacing the text in angle brackets.

wdContext.currentEmailElement().setFrom("name@company.com");

wdContext.currentEmailElement().setTo("name@company.com");

wdContext.currentEmailElement().setCc("");

wdContext.currentEmailElement().setBcc("");

wdContext.currentEmailElement().setSubject("Travel Request Form");

wdContext.currentEmailElement().setBody("BlaBlaBla");

//@@end

In the coding is no error. In the Context node of the SendView I created a new value node with the value attributes. When writing the code and using strg+space i can complete automatically, so no writing errors.

When deploying and running the application I get always a NullPointerException, if make no difference if i delete one entry or which line of code i insert, the same error.

java.lang.NullPointerException

at com.ao.test.emailtest.SendView.wdDoInit(SendView.java:99)

at com.ao.test.emailtest.wdp.InternalSendView.wdDoInit(InternalSendView.java:127)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)

at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)

at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:274)

at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)

I've compared my project with the one from tutorial but i found no differences.

Have anybody have an idea what to do?

Thanks

Mathias