i want to prevent use of code getDefaultInstance
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   manjunath_somashekar
Posted On:   Thursday, March 6, 2003 02:49 AM

hi all i am creating a mail session in the Weblogic console and set the properties mail.smpt.auth=true mail.smtp.host=mailserver. in my code i do a lookup of the mail session created as shown below /* mailSession = (Session)context.lookup(MAIL_SESSION_JNDI_NAME); */ now when i send the mail within our intranet, it works fine. but when i want to send a mail to my yahoo account i get javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.SendFailedException: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 550 5.7.1 Unable to relay for @yahoo.com but when i have this code props.put("ma   More>>

hi all

i am creating a mail session in the Weblogic console and set the properties mail.smpt.auth=true mail.smtp.host=mailserver.

in my code i do a lookup of the mail session created as shown below
/*
mailSession = (Session)context.lookup(MAIL_SESSION_JNDI_NAME);
*/

now when i send the mail within our intranet, it works fine. but when i want to send a mail to my yahoo account i get

javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 550 5.7.1 Unable to relay for @yahoo.com

but when i have this code
props.put("mail.smpt.auth", "true");
props.put("mail.smtp.host", "mailserver");
Session newSession = mailSession.getDefaultInstance(props, new SMTPAuthenticator(user, pass));

the mail is sent successfully. but i don't want to do this every time i want to send a mail.

is there any alternative

regards
manju

   <<Less
About | Sitemap | Contact