Hello Sir,
Please, check my following code is it correct or not? Because, I can received E-mail But I am not getting message on Mobile.
//package com.psol.xslist;
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
public class SendMessage
{
public static final void main(
String[] args)
{
try
{
Properties props = System.getProperties();
props.put("mail.smtp.host","172.24.11.19");
Session session = Session.getDefaultInstance(props);
Message message = new MimeMessage(session);
InternetAddress from = new InternetAddress("administrator@msubaroda.ac.in");
InternetAddress to[] = InternetAddress.parse("yatin_39@hotmail.com,9825343210@west.hutch.co.in");
message.setFrom(from);
message.setRecipients(Message.RecipientType.TO,to);
message.setSubject("Server Information");
message.setSentDate(new Date());
message.setText("Server is working.");
Transport.send(message);
}
catch(MessagingException e)
{
System.err.println(e.getMessage());
}
}
}
Thanking You
Yatin