dcsimg
Search !_NEWLINE_! code works fine with no exception.but message is not sent!_NEWLINE_! !_NEWLINE_!code works fine with no exception.but message is not sent
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Radhakrishnan_Chellappen
Posted On:   Wednesday, May 30, 2001 12:11 PM

My prev question was not properly aligned , once again its here i got the code working fine with no exceptions . (i am catching the exception and logging it.)but message is not sent to the email address. what could be the problem ?. Here is the code.SMTP mail server is running in my local machine. please help me props.put("mail.smtp.host", "localhost" ); sess = javax.mail.Session.getDefaultInstance(props, null); sess.setDebug( Boolean.valueOf( "false" ).booleanValue() ); MimeMessage msg = new MimeMessage(sess); msg.setFrom(new InternetAddress( "xyz")); msg.setRecipients(Message.RecipientType.TO, address); msg.setSubject( "Test Mail");    More>>

My prev question was not properly aligned , once again its here

i got the code working fine with no exceptions . (i am catching the exception and logging it.)but message is not sent to the email address. what could be the problem ?. Here is the code.SMTP mail server is running in my local machine. please help me


props.put("mail.smtp.host", "localhost" );
sess = javax.mail.Session.getDefaultInstance(props, null); sess.setDebug( Boolean.valueOf( "false" ).booleanValue() );

MimeMessage msg = new MimeMessage(sess);

msg.setFrom(new InternetAddress( "xyz"));
msg.setRecipients(Message.RecipientType.TO, address); msg.setSubject( "Test Mail");

/*MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText( "Test Mail Sucess" ); Multipart mp = new MimeMultipart(); mp.addBodyPart(mbp1);
if ( ! mailAttachments.isEmpty() )
//MimeBodyPart mbp2 = new MimeBodyPart();
msg.setContent(mp);*/

msg.setText("Hai This is a test mail"); msg.setSentDate(new Date()); Transport.send(msg);

   <<Less
About | Sitemap | Contact