cancel
Showing results for 
Search instead for 
Did you mean: 

Email problem

Former Member
0 Kudos

Hi all,

I am following the blog by Giridharan S from SAP Labs India

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0bf26e2-9bb3-2910-ea87-ee67a8ad5ab6">Using JavaMail in Web Dynpro Java applications for sending e-mails</a> I am not able to resolve Session, MimeMessages,InternetAddress, even when i choose organize imports.

Can any one tell me what I need to import to resolve the above.

regards

Deepu

Accepted Solutions (1)

Accepted Solutions (1)

former_member186016
Active Contributor
0 Kudos

Hi,

Go to following link:

<a href="https://maven-repository.dev.java.net/nonav/repository/javax.mail/jars/">Java Mail url</a>

Download the jar mail-1.4.jar to your system.

Add this jar to your project classpath and then do "organise import" in your class.

Hope it helps.

Regards,

Ashwani Kr Sharma

Former Member
0 Kudos

Hi ashwini,

thanks for the quick response and resolving the issue, but still I am facing some errors while using the code...

could you please help me out in knowing the line

<b> message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));</b>

its adding the recipient, but what are the parameters. when I am using the code as it is... its giving error in the first parameter.

and also at

<b>Transport.send(message); </b> here the methode send() is not exist. it is also giving error

abhijeet_mukkawar
Active Contributor
0 Kudos

Hi,

check out this: Message.RecipientType.TO specifies the recipients address,

http://java.sun.com/products/javamail/javadocs/javax/mail/Message.RecipientType.html

and

if send() is anavailable try using,

transport.sendMessage(message,

message.getRecipients(Message.RecipientType.TO));

for reportSuccess():

wdComponentAPI.getMessageManager.reportSuccess("Success");

hope it helps

regards

Former Member
0 Kudos

Abhijeet/Ashwani,

Thank you very much, all my problems resolved.... But only one

might be the silly doubt but, as I didnt use it till now.... I dont know about SMTP Host.

could you tell me what I need to use in place of Host.

abhijeet_mukkawar
Active Contributor
0 Kudos

Pradeep,

it is like:

props.put("mail.smtp.host","172.17.25.29");

IP address of your SMTP host. (Simple Mail Transfer Protocol) this helps in communication by means of mail.

regards

reward points if it helps

Former Member
0 Kudos

Thanks a lot Abhijeet... right now I dont have that information, I mean what is our SMTP server... but I am sure after giving it my code will work.

Thanks

Answers (3)

Answers (3)

Former Member
0 Kudos

some more problems to resolve.

abhijeet_mukkawar
Active Contributor
0 Kudos

what are they?

Former Member
0 Kudos

sorry for spelling your name wrongly. its Ashwani...

and thanks to abhijeet tooo.

one more thing is i couldnt get

<b>messageMgr.reportSuccess("Mail Sent Successfully");</b>

is it MessageManager??? but its not prepopulating any method.

Help me out in resolving those

former_member186016
Active Contributor
0 Kudos

Hi,

<b>messageMgr</b> must the webdynpro Messagemanager.

You can get this by

wdComponentAPI.getMessageManager();

Regards,

Ashwani Kr Sharma

former_member186016
Active Contributor
0 Kudos

Hi,

You can get full information and resources for JavaMail from following location:

<a href="http://java.sun.com/products/javamail/downloads/index.html">Java Mail Full</a>

Regards,

Ashwani Kr Sharma

abhijeet_mukkawar
Active Contributor
0 Kudos

Hi,

write this

import javax.mail.Session;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

regards

Former Member
0 Kudos

when i import those its giving error.....

javax.mail.Session can not resloved

javax.mail.internet.InternetAddress can not resolved

javax.mail.internet.MimeMessage can not resolved

what i need to do?

abhijeet_mukkawar
Active Contributor
0 Kudos

Hi,

seems you are doing local project, here you need to add external JAR.

https://maven-repository.dev.java.net/nonav/repository/javax.mail/jars/

find here the mail.jar , save it on your disk and then right click on project, goto properties ->java build path->add external jar, and the jar then try to import the files

regards