Mail Subject charset
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   prachi_jain
Posted On:   Wednesday, January 29, 2003 04:58 AM

Hello All, I am using a MailHandling class to send mails in my application. When there is a special character such as german umlauts in the "mail subject" comes up...the subject is not interpreting the umlauts. What i have in my mailhandler class is: To create a new Message: public void createNewMessage() { java.util.Properties props = System.getProperties(); if ( sMailHost!=null ) { props.put("mail.smtp.host", sMailHost); } if ( sMailPort!=null ) { props.put("mail.smtp.port", sMailPort); } Authenticator auth = null; if ( sUser!=null && sPassword != null ) { auth = new SMTPAuthenticator(); ((   More>>

Hello All,


I am using a MailHandling class to send mails in my application. When there is a special character such as german umlauts in the "mail subject" comes up...the subject is not interpreting the umlauts. What i have in my mailhandler class is:



To create a new Message:


			
public void createNewMessage() {

java.util.Properties props = System.getProperties();
if ( sMailHost!=null ) { props.put("mail.smtp.host", sMailHost); }
if ( sMailPort!=null ) { props.put("mail.smtp.port", sMailPort); }

Authenticator auth = null;
if ( sUser!=null && sPassword != null ) {
auth = new SMTPAuthenticator();
((SMTPAuthenticator) auth).setUser( sUser );
((SMTPAuthenticator) auth).setPassword( sPassword );
}

javax.mail.Session session = javax.mail.Session.getInstance(props, auth);
message = new MimeMessage(session);
multipart = new MimeMultipart();
}

where message is declared as private Message message;



moreover i have a setSubject method:


			
public void setSubject(String sSubjectPar)
throws MessagingException {

message.setSubject(sSubjectPar);
}

What i tried to do is ::
			
private MimeMessage messageSubject;

declare it in createNewMessage method
messageSubject = new MimeMessage();

then in setSubject Method:
messageSubject.setSubject( sSubjectPar, "ISO-8859-1");

But, it didn't give me results as expected.


Please help...it'S really urgent.



thanks and regards

   <<Less

Re: Mail Subject charset

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, January 29, 2003 07:24 AM

About | Sitemap | Contact