cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving SMTP Server Host name

Former Member
0 Kudos

Hi All,

I have to send mails from SMTP server which has been configured on my Portal Server.

Can any body tell me how I can read the SMTP server host name using Web Dynpro/Java API?

Regards,

Sruti

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Use this statement to get the smtp and host name.

String mailHost = System.getProperty("mail.smtp.host");

String Host = System.getProperty("HostName");

Check the system properties for more information through system information.

Thanks and Regards,

Manjunath

Former Member
0 Kudos

Hi Shruti,

Go Through this Blog it might be useful in your case.

[Send mail with attachment using web dynpro API's |http://wiki.sdn.sap.com/wiki/display/WDJava/Sendmailwithattachmentusingwebdynpro+API%27s]

[Sending mail with an online interactive form(pdf) as an attachment.|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8551] [original link is broken] [original link is broken] [original link is broken];

Regards

Jeetendra

Former Member
0 Kudos

Hi Jeetendra

In the links that you have given, the user already knows the Mail Sever Host name.

In my case, I don't know the Server Host name. I want to read it dynamically using Web Dynpro/Java API.

Regards,

Sruti

Former Member
0 Kudos

Hi,

Please have a look at this information,

http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html

Regards,

Saravanan K

Former Member
0 Kudos

Hi Sruti,

Package com.sun.mail.smtp

An SMTP protocol provider for the JavaMail API that provides access to an SMTP server.

Pls refre this link :-http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html

mail.smtp.host-> String-> The SMTP server to connect to.

Hope this may help you.

Deepak!!!