but now i using it in my college lab. we have broadband internet connection, but dont know what kindof connection..
Here is my Code
Expand|Select|Wrap|Line Numbers
- 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..