SMTP Mail Server Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajujrk
    New Member
    • Aug 2008
    • 107

    #1

    SMTP Mail Server Problem

    Hi all,

    I am currently doing a project (Send and receive an Email) in Java using the JavaMail API...

    It ask for SMTP mail server..

    How to find the mail server details..
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    You don't need to give it any details; just the name of the smtp host is enough; put it in the system properties file associated with the key "mail.smtp.host " e.g.

    Code:
        String host = "smtp.yahoo.com";
    
        // Get system properties
        Properties props = System.getProperties();
    
        // Setup mail server
        props.put("mail.smtp.host", host);
    It's all in the API documentation; read it.

    kind regards,

    Jos

    Comment

    Working...