cancel
Showing results for 
Search instead for 
Did you mean: 

Java error while compiling Web Dynpro program

Former Member
0 Kudos

Hi Experts,

I am getting following error message while compiling Web Dynpro program. The erring lines are as below:

Message message = new MimeMessage(session);

try {

message.setFrom(new InternetAddress(fromMailId));

message.addRecipient(

Message.RecipientType.TO,

new InternetAddress(toMailId));

message.setSubject(mailSubject);

message.setText(mailBody);

message.setHeader("X-Mailer", "E-Mail");

message.setSentDate(new Date());

Transport.send(message);

The error messages are:

Message.ReceipientType can not be resolved

The method send(Message) is undefined for the type Transport

The method setFrom(InternetAddress) is undefined for the type Message

The method setHeader(String, String) is undefined for the type MessageThe method setSentDate(Date) is undefined for the type Message

The method setSubject(String) is undefined for the type Message

The method setText(String) is undefined for the type Message

Type mismatch: cannot convert from MimeMessage to Message

Can you please help me in resolving the issue. It seems that some API is missing. I believe if some one can tell me the name of JAR file / API then I will be able to sort out the issue. I will add these JAR file in my program.

Thanks,

S

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member193726
Active Participant
0 Kudos

Hi Stuart,

Please check the blog below which explains similar scenario.

/people/sap.user72/blog/2005/06/08/sending-attachments-in-mails

Here Noufal gave an example of sending a mail with attachment, whereas you are trying to send the mail without attachment.

He has stated the jar files required for the code and also the path involved. Please include the same.

Hope this helps.

Regards,

Rekha Malavathu

former_member185029
Active Contributor
0 Kudos

Hi,

Have you imported the required JavaMail jar?

Please tell me what API you are using for the same.

Also check forum to check how to add external jar files into WebDynpro project

Let me know if you need more help on it.

Regards,

Ashutosh