cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Email

Former Member
0 Kudos

Hi all,

How to send main in WebDynpro java. I want to send a link and a id to one person after button click. how to do this.

regards,

shreeharsha

Accepted Solutions (0)

Answers (2)

Answers (2)

p330068
Active Contributor
0 Kudos

Hi Sreeharsha

Please refer to [Web Dynpro Applications Using the JavaMail API|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2678e05a-0701-0010-fa86-ddfbec5a2b94]

Hope it helps

Regards

Arun

Former Member
0 Kudos

Hi Arun,

i am getting an error message "Failed to create request".what is the reason.

when i run the java program in the eclipse i gave me the following error

Exception while sending mailSending failed; nested exception is: javax.mail.AuthenticationFailedException javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.AuthenticationFailedExceptionResult:false at javax.mail.Transport.send0(Transport.java:219) at javax.mail.Transport.send(Transport.java:81) at com.sap.client.sendmail.SendMail.sendMail(SendMail.java:46) at com.sap.client.sendmail.SendMail.main(SendMail.jav

regards,

shreeharsha

p330068
Active Contributor
0 Kudos

Hi Shreeharsha,

Please check the user authentication...in while creating Authenticator object. You need to create jave file and place in the wd project.

public class Auth extends Authenticator {

public PasswordAuthentication getPasswordAuthentication()

{

String username = "";

String password = "";

return new PasswordAuthentication(username,password);

}

}

verify your SMTP port and host....check if default port 25 is open or not for accetpting mails

Hope it helps

Regards

Arun

Former Member
0 Kudos

Hi Arun,

What host name i have to give? will it work if i give host name gmail or the ip address.

i have created authentication class in wd project. after that it is giving below error.

what user name and passwd i have to give.

Exception while sending mailSending failed;

nested exception is:

javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25

javax.mail.SendFailedException: Sending failed;

nested exception is:

javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25

at javax.mail.Transport.send0(Transport.java:219)

at javax.mail.Transport.send(Transport.java:81)

at com.sap.client.sendmail.SendMail.sendMail(SendMail.java:47)

at com.sap.client.sendmail.SendMail.main(SendMail.java:58)

Result:false

regards

shreeharsha

p330068
Active Contributor
0 Kudos

Hi Shreeharsha,

You need to provide your company SMTP mail detail like while setting in the properties and use port 25 in transport creation if required.

String host = "<SMTP Details like SMTP server name + Company Domain>";

// Initialize Session

Properties props = System.getProperties();

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

props.put("mail.smtp.auth", "true");

Authenticator auth = new <Auth class that extend Authenticator>();

Session session = Session.getInstance(props, auth);

>> What host name i have to give? will it work if i give host name gmail or the ip address.

User your company SMTP Details. I don't think it will work..try it.

>> what user name and passwd i have to give.

Your mail user id and password will work.

You can very using telent with above details for sending mail with port 25 is open or not.

Hope it helps

Regards

Arun

Former Member
0 Kudos

Please have a look at these threads,

- Saravanan K