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
How to find out the SMTP mail server..
This is a stand alone program, used in any machine..
Thanks in Advance..
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);
}
}
This is a stand alone program, used in any machine..
Thanks in Advance..
Comment