The moose likes Other JSE/JEE APIs and the fly likes Losing mails Between SendMail and exchange Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "Losing mails Between SendMail and exchange" Watch "Losing mails Between SendMail and exchange" New topic
Author

Losing mails Between SendMail and exchange

David Rocks
Ranch Hand

Joined: Apr 24, 2001
Posts: 160
I am hoping that someone could help me discover why my mail program using sendmail on solaris cannot seem to send mails to an exchange server. I can send mail to hotmail and other such addresses. It must be a flag that gets set in the message but i cannot work out what it is. This is the method that i use.
public synchronized void sendMessage( String sendTo , String subject , String contents , String from , String replyTo ) throws Exception {

// create a message
MimeMessage msg = new MimeMessage( session );
InternetAddress[] address = { new InternetAddress( sendTo ) };

msg.setRecipients( Message.RecipientType.TO, address );
msg.setFrom( new InternetAddress( from ) );
InternetAddress intAddressArray[] = { new InternetAddress( replyTo ) } ;
msg.setReplyTo( intAddressArray ) ;
msg.setSubject( subject );
msg.setSentDate( new Date() );

MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText( contents );

// create the Multipart and its parts to it
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);

msg.setContent(mp);

// send
Transport.send(msg);
}
If anyone has even a small suggestion it would be much appreciated
Yours
David Raid
 
 
subject: Losing mails Between SendMail and exchange
 
Threads others viewed
Sending dynamic content by email in jsp
Java mail problem
Sending mail through Exchange Server
sending email with java MS exchange server
Attaching files using Java Mail API
IntelliJ Java IDE