on 02-12-2008 12:03 PM
Error :
javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingException: Unknown SMTP host: mail.yochanatech.com ; nested exception is: java.net.UnknownHostException: mail.yochanatech.com
In visual administrator
SMTP hostname : mail.yochantech.com
this my code ;
String host ="mail.yochanatech.com "; // Specify the host
// Get the From Address
// String from = wdContext.currentContextElement().getFromAddress();
String from ="arjun@yochanatech.com";
// Get the To Address
// String to = wdContext.currentContextElement().getToAddress();
String to="arjun@yochanatech.com";
// Initialize Session
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
Session session = Session.getDefaultInstance(props, null);
// Create new MimeMessage
MimeMessage message = new MimeMessage(session);
IWDMessageManager messageMgr = wdControllerAPI.getComponent().getMessageManager();
try {
// Set the From Address
message.setFrom(new InternetAddress(from));
// Set the To Address
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
// Set the Subject
message.setSubject("Test Mail");
// Set the Text
// message.setText(wdContext.currentContextElement().getTextMessage());
message.setText("test mail trigered");
// Send message
Transport.send(message);
messageMgr.reportSuccess("Mail Sent Successfully");
} catch (AddressException e) {
messageMgr.reportException(e.toString(),false);
} catch (MessagingException e) {
messageMgr.reportException(e.toString(),false);
}
when i debug the code
Transport.send(message);
it is not exceuting
Thxs
ARJUN.G
Hi,
have you tried with the IP of the respective host.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arjun,
Check the host name again (the spelling)
according to u in visual admin it : SMTP hostname : mail.yochantech.com
In ur code its : mail.yochanatech.com
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is SMTP Port configured in the server system.
Regards,
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.