hi all,
i have been trying to send an email using a java funstion. below is my code.
im using oracle server host and port no 80
code:
"
public static void main(String [] args)
{
// Recipient's email ID needs to be mentioned.
String to = "spriha.awin.pushpam@oracle.com";
// Sender's email ID needs to be mentioned
String from = "spriha.awin.pushpam@oracle.com";
// Assuming you are sending email from localhost
String host = "stbeehive.oracle.com";
// Get system properties
Properties properties = System.getProperties();
// Setup mail server
properties.setProperty("mail.smtp.host", host);
properties.setProperty("mail.smtp.port", "80");
properties.setProperty("mail.smtp.connectiontimeout", "100000");
properties.setProperty("mail.smtp.timeout", "1000");
System.out.println("email.Email.main() "+properties.getProperty("mail.smtp.port"));
// Get the default Session object.
Session session = Session.getDefaultInstance(properties);
try{
// Create a default MimeMessage object.
MimeMessage message = new MimeMessage(session);
// Set From: header field of the header.
message.setFrom(new InternetAddress(from));
// Set To: header field of the header.
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
// Set Subject: header field
message.setSubject("This is the Subject Line!");
// Now set the actual message
message.setText("This is actual message");
System.out.println("email.Email.main() "+message.getSubject());
// Send message
Transport.send(message);
System.out.println("Sent message successfully....");
}catch (MessagingException mex) {
mex.printStackTrace();
}
}
"
it stops at transport.send(message);
please help
thank you
spriha