Finding SMTP mail server

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

    Finding SMTP mail server

    hi, i am currently sending mail through the JavaMail API. I had a problem to find out the SMTP mailserver. First i tried in airtel broadband Connection its works fine..
    but now i using it in my college lab. we have broadband internet connection, but dont know what kindof connection..
    Here is my Code
    Code:
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    
    class SendMail{
      public static void main(String[] jrk)throws Exception{
      String email="tomail@gmail.com";
      Properties props = new Properties();
      props.put("mail.smtp.host", "smtp.tn.airtelbroadband.in");
      
      Session s = Session.getInstance(props, null);
      MimeMessage message = new MimeMessage(s);
      InternetAddress from = new InternetAddress("frommail@gmail.com");
      message.setFrom(from);
      
      InternetAddress to = new InternetAddress(email);
      message.addRecipient(Message.RecipientType.TO, to);
      message.setSubject("Login Information");
      message.setText("Thank you for logged in..");
      Transport.send(message);
     }
    }
    How to find out the SMTP mail server..
    This is a stand alone program, used in any machine..

    Thanks in Advance..
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    You should probably ask your professor/instructor about the mail server name, it should work. Also, if you're not supposed to know it, you cannot connect to it.

    Hope this helps direct you!

    In a bit...

    Comment

    Working...