How to identify the name of my smtp-mail host dynamically?

Hi,
I want to send an email from my system which has an internet connection.
I don't know how to identify and mention the name of my smtp server ie; the smtp-host name that should be mentioned in my propetries object 'props' as props("mail.smtp.host","smtphostname");
I want this program to work on other systems also,ie; It should dynamically find out what is the smtp-email host for the computer on which the program is running and set the smtp-host name in the 'properties' object dynamically.
I will be thankful if anybody sends me code to solve this problem.
Thank u in advance,
Ravi.

Write a mail scan to look for typical settings
such as domain, mail.domain, smtp.domain, smtp.mail.domain
where domain is after @ in an email address
Have a SocketSearch class that uses non blocking via java.nio.channels.*
so it can be interruptable and scan for these typical mail settings on default port 25 - The code using these interruptable socket can each be threaded to find the host/port and should find it in seconds
Once found, store the settings in a configuration so you don't have to scan again unless it doesn't work anymore...
If can't find the socket host/port via typical settings, next use a Java class that does a nslookup based on MX records - For example if you type "nslookup -type=mx javasoft.com" and you get mail exchanger = mail.java.sun.com and if you "telnet mail.java.sun.com 25" - you can see the port is open for sending emails.
No expert in MX records for a domain to find the exact one and someone else can share some light on this...

Similar Messages

  • How to Identify the Type of Font Names in Illustrator

    How to identify the type of font names like "True Type font" (or) "open Type font" for illustrator file using Scripts or any language. Could you please advice me.
    Thanks,
    Prabudass

    If there is an Illustrator SDKor Illustrator Scripting forum, try
    that. ATM won't really help - it is obsolete and should not be
    installed (breaks things).
    Aandi Inston

  • How to identify the psa table names in bi 7?

    Hi all,
    How to identify the psa table names in bi 7?  i need to know the psa table name in bi 7?
    as well as i need to check whether any historical data loads is there for psa for a particular period?
    How to filter for a particular data in the psa in bi 7?
    Thanks
    Pooja

    Hi Pooja,
    A)How to identify the psa table names in bi 7? i need to know the psa table name in bi 7?
    Double click on the PSA and CTRLSHIFTF5 --->in PSA properties -->PSA table ..u can find the name here ....
    B)as well as i need to check whether any historical data loads is there for psa for a particular period?
    usually as SAP best practise we will not keep data in PSA for not more than 30 days or at the amx 60 days..you may not find historical data here..however to find the oldest data -->Right Click >Manage>Give some old date ,say 01.01.2005 in the Request newer than ...and Refresh.....
    Other way is to find out in the Data provider i.e in the Cube or DSO ...
    How to filter for a particular data in the psa in bi 7?
    a)Do not map it
    b)in the DTP...Filter it ....i.e from PSA -->CUBE/DSO....
    c)Or write a routine also in start routine ...
    Rgds
    SVU123

  • How to identify the textbox name if they are generated dynamically

    hi
    i want to know how to identify the textbox name when they are generated dynamically. the text boxes name may vary.
    if u know tell me.
    thanx

    Try the following Code :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <SCRIPT language="Javascript">
    function fnShowTextBoxNames()     {
         var count = document.formHeader.elements.length;
         for(i=0;i<count;i++)     {
              var objType = document.formHeader.elements.type;
              if(objType=="text")     {
                   alert("Name Of TEXTBOX NO "+(i+1)+" --> "+document.formHeader.elements[i].name);
    </SCRIPT>
    <BODY>
    <FORM name="formHeader">
    <CENTER>
    <INPUT TYPE="TEXT" name="box1" value="" >
    <br>
    <INPUT TYPE="TEXT" name="box2" value="" >
    <br>
    <INPUT TYPE="TEXT" name="box3" value="" >
    <br>
    <INPUT TYPE="TEXT" name="box4" value="" >
    <br>
    <INPUT TYPE="TEXT" name="box5" value="" >
    <br><br>
    <input type="button" name="btn" value="Show TextBox Names" onClick="javascript:fnShowTextBoxNames();">
    </CENTER>
    <input type="hidden" name="boxCount" value="5"/>
    </FORM>
    </BODY>
    </HTML>
    Hope this suffice ur requirement !

  • How to identify the infosource name for any ods zpxrrm?

    hi all,
    How to identify the info source name for any ods that have created.
    thanxs
    haritha

    Hi Haritha,
                   Check the datasources from which the data is coming to the ODS.Take the technical name of the data source.Check in Infosources Tab.There you can find in which infosources the ODS is present.
    Hope this solves
    Regards
    Karthik
    Assign points if helpful.

  • How to identify the type of Fonts

    How to identify the type of font names like "True Type font" (or) "open Type font" for illustrator file using Scripts. Could you please advice me.
    Thanks,
    Prabudass

    The code below will prompt the user with the type face of a single text-frame.
    shastafir
    // 5/4/2009
    // Open a new document and create a single text box
    // with some type in it.
    // Get access to the active layer
    var aiDocument = app.activeDocument;
    var aiLayer = aiDocument.activeLayer;
    // Get access to the type-frame's font
    var textBox = aiLayer.textFrames[0];
    var theFont =
    textBox.textRange.characterAttributes.textFont;
    // Alert user with the name of the font
    alert(theFont.name);

  • How to identify the alternative payee in payment run

    Hi All
    How to identify the alternative payee details in payment run by using transaction code F110 or which table or fields contain the alternative payee details for example REGHU & REGUP.
    How to identify the alternative payee details from system level. Any Update.
    Regards
    K.Gunasekar.

    Hi,
    EMPFG (Payment Recipient ) field in REGUH will give you the alternate Payee name of the Payment run executed in F110.
    Regards,
    SAPFICO

  • Why is Mail asking me for the name of an smtp server for an email address that doesn't exist?

    I've migrated from Snow Leopard to Mountain Lion on a new Mac, but in trying to use Mail on ML, it keeps asking me for the name of an smtp server for an email address that's never existed. The addy has my user name correct, but the server part of the address doesn't exist, or at least I've never used an email address with that provider. On ML there's no plist file for Mail, so nothing to delete there. What else can I do to get Mail working? The only other option I have is to abandon Mail as being crippled and useless, and use Postbox, which for it's price (US$9.95) is an attractive option. OTOH, I've paid for Mail after all, so it really ought to work. Any clues as to what I can do to stop its nonsensical behaviour? How do I file a bug report?
    TIA.
    Pauline

    Amasis wrote:
    On ML there's no plist file for Mail, so nothing to delete there.
    ~/Library/Containers/com.apple.mail/Container.plist
    (Go to your Finder "Go" menu hold the option key to choose "Library", since the ~/Library is hidden on ML)

  • How to identify the right extractor

    hi all,
    i have a custom extractor(ABAP report) to pull the Std cost info into BW from R/3. I would like to remove this custom extractor and go for a generic one. Can anyone provide me the steps on how to identify the appropriate generic extractor.
    i know the underlying tables names....eg KEKO, KEPH etc

    Hi Vinod,
    There will no appropriate generic extractor as such. Generic Extration itself means creating a custom extractor. All you need to do is
    1.Goto RSO2, select the type of datasource(i.e transaction or Masterdata)
      and click on create
    2. Specify the table name, ( if you are pulling data from two tables then you have to create a view at Tcode se11, then you need specify that view here)
    3. click on generate
    This will generate the datasource
    You can refer the following doc for further assistance,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Thanks
    Vj

  • Serious Issue - CRM 2007 issue - How to identify the Log in CRM

    Hi Experts,
    How to identify the Billing Account Deletion log. Some billing accounts has been deleted from BUT000 table. We have to find out -who has deleted and when ???
    Please help us to identify the log. I think in SAP log should be maintained somewhere in CRM.
    Thanks & Regards,
    Amit Nanda
    9999795569

    hi,  I remeber the there is a function name like  CRMXXDocumentXXlock  which is be called in standard program to maintain order.
    I can't login a crm server, can't offer you the accurate name, you can do a search in system.

  • How to identify the number of clients in server

    Hai
    Iam trying a network program to identify the number of clients which accessing the server. I dont no how to identify the number of clients which accessing the server through server machine. I want to identify the client machine ip or name. If you have any idea help for me.
    Regards
    A.KRaj

    You can keep a ArrayList of active connections and store the IP address of the incoming connection in the Server. You have to do this everytime you accept a connection.

  • How to identify the t-codes like s_alr-* t-codes

    Hi, Please advise how to identify the s_alr t-codes in the r/3 system. for example, we can set the config of same node with op40 t-code as well as with S_ALR_87006275 t-code. how to know the s_alr_*** t-codes in sap system. thanks for your support.

    Raju,
    Although OP40 and S_ALR_87006275 may look the same to you, they are not the same.
    You can review information about transactions using the repository (SE84 > other objects > transactions) to find out more about them.  As mentioned by the other gurus, you can also do a table lookup to find out the transaction names that exist.
    Don't expect any kind of consistency in the way SAP deals with transactions assigned to configuration nodes.   There isn't any.  Not all IMG nodes will have s* transactions assigned to them.  Actually, many nodes have no transactions assigned to them.
    Best Regards,
    DB49

  • How to identify the standard ods / cubes are delta capable or not?

    Hi All,
    How to identify the standard ods / cubes are capable of handling delta o not ?
    Pls advise me on this!!
    Thanks
    Pooja

    Hi Pooja
    Delta capable is based on datasource but not on ODS or cube.
    You can get this info from ROOSOURCE table,give data source name and check the field "DELTA".
    If the field is left blank,it implies that the datasource is not delta capable.
    Regards
    Jagadish

  • How to change the name and description of a wim using DISM

    With Imagex we could update the name and description of the wim with on easy command:
    imagex /info img_file [img_number or
    img_name] [new_name] [new_desc]
    e.g.
    imagex /info Win7Combined.WIM 1 "Win7(x86)" "Windows 7 x86"
    Since the ImageX tool is deprecated in Windows 8 and has been replaced with DISM, can someone explain how to update the name and description with one easy command using DISM like we could with Imagex?

    It looks like this person had the same issue. Have you seen this
    link
    It talks about exporting an Index into a new WIM. Which, in a way, would be renaming it. It's really recreating it and you have to give it a name. But it seems to work.
    Dustin Estes - MCP | www.dustinestes.com

  • How to find the Names of Most costly Views or Most Time consuming views

    Hi All,
    I had a database consisting of almost 200 views,as a part of Optimization process i want to find out the most costlier views.How to do that.Actually i want the names of the VIEWS,so that i can optimize that.Can any one help me out?
    I had one more doubt in our Database a view is created like view A( which is created by joining several tables).so do i need to add index on this view separately or does it take the index of the tables which i joined? And in our Database i  had created
    a VIEW which is derived from other views(the Joining objects are views not tables),so while i select recoreds from this views which is derived from other views it is taking a lot of time.Is tehre any problem with that?

    Please avoid such double post spread over several forums:
    http://social.msdn.microsoft.com/Forums/en-US/bae4042a-10b8-4d12-aa46-88a05ea37a76/how-to-find-the-names-of-most-costly-views-or-most-time-consuming-views?forum=sqldataaccess
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for