dcsimg
When i sent emails to accounts with Microsoft Exchange Server i get errors
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andreas_Runde
Posted On:   Thursday, September 5, 2002 06:17 AM

When i sent emails out of an webinterface with javamail to accounts which uses Microsoft Exchange Server i get the following errors. When then message includes some characters like the german 'ä', 'ö', 'ü' or the 'ß' the recipient gets the message with the following comment: "This message contains characters which not support by internet services" Otherwise i get the same error, when i attach a Microsoft Word or Excel File. Then the message-error is the same ... After this i include my sourcecode. Please help me. public int sendMessage(String Sender, String Recipient, String Subject, String Message, String[] filename) throws MdBMailException { P   More>>

When i sent emails out of an webinterface with javamail to accounts which uses Microsoft Exchange Server i get the following errors.
When then message includes some characters like the german 'ä', 'ö', 'ü' or the 'ß' the recipient gets the message with the following comment:

"This message contains characters which not support by internet services"

Otherwise i get the same error, when i attach a Microsoft Word or Excel File. Then the message-error is the same ...

After this i include my sourcecode.

Please help me.



public int sendMessage(String Sender, String Recipient, String Subject, String Message, String[] filename) throws MdBMailException

{

Properties props = System.getProperties();

props.put("mail.smtp.host", Hostname);

Session session = Session.getDefaultInstance(props, null);


Message msg = new MimeMessage(session);

MimeBodyPart msgBP = new MimeBodyPart();

Multipart msgMP = new MimeMultipart();

DataSource source;


try

{

if (Absender != null)

msg.setFrom(new InternetAddress(Sender));

else

msg.setFrom();

msg.addRecipient(javax.mail.Message.RecipientType.TO,
new InternetAddress(Recipient));

msg.setSubject(Subject);

msgBP.setText(Message,"ISO8859-9");

msgBP.setContentID("Part 0");

msgMP.addBodyPart(msgBP);
 


for (int i=0; i

{

source = new FileDataSource(directory+filename[i]);

msgBP = new MimeBodyPart();

msgBP.setDataHandler(new DataHandler(source));

msgBP.setFileName(filename[i]);

msgBP.setContentID("Part "+(i+1));

msgBP.setDisposition(msgBP.ATTACHMENT);

msgMP.addBodyPart(msgBP);

}
 


msg.setContent(msgMP);

Transport.send(msg);
 


Can you help me???

   <<Less

Re: When i sent emails to accounts with Microsoft Exchange Server i get errors

Posted By:   Sebastian_Lupu  
Posted On:   Monday, September 23, 2002 09:16 AM

Try to use some MimeUtility.encodeText method for not having problems with special characters.



HTH,

Seaba
About | Sitemap | Contact