Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String args[])
- {
- String url1;
- Properties prop = new Properties();
- try{
- InputStream input = new FileInputStream("config.properties");
- prop.load(input);
- System.out.println(prop.getProperty("url"));
- url1=prop.getProperty("url");
- final URL url = new URL(url1);
- HttpURLConnection huc = (HttpURLConnection) url.openConnection();
- int responseCode = huc.getResponseCode();
- if (responseCode != 404) {
- System.out.println("GOOD");
- } else {
- System.out.println("BAD");
- }
- }
- catch(Exception e)
- {
- String username ,password,host,port;
- username=prop.getProperty("username");
- password= prop.getProperty("password");
- host=prop.getProperty("host");
- port=prop.getProperty("port");
- System.out.println("username"+username);
- SendEmail email=new SendEmail(username,password,port,host);//user name and password
- email.sendMail("mohamedf.sharif@ril.com", "hey", "whats up");
- email.sendMail("fazal.shariff12@gmail.com", "hey", "whats up");
- //e.printStackTrace();
- System.out.println("done");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement