[ http://issues.apache.org/jira/browse/COCOON-1438?page=all ]
Jörg Heinicke updated COCOON-1438: ---------------------------------- > [MAIL] Weird Encoding problem with SendMailAction > ------------------------------------------------- > > Key: COCOON-1438 > URL: http://issues.apache.org/jira/browse/COCOON-1438 > Project: Cocoon > Issue Type: Bug > Components: Blocks: Mail > Affects Versions: 2.1.6 > Environment: Operating System: Windows XP > Platform: PC > Reporter: Gabriel Gruber > Assigned To: Cocoon Developers Team > > I have a flowscript, wich uses the sendmailaction to send a mail. > As the mail is supposed to be a html-mail, it is generated through a cocoon- > pipeline and feeded by a request-param which contains the body-text. > this body-text is first submitted by a cform. > the cform correctly delivers the bodytext (after changing all the encoding > settings in the web.xml and serializer configs to "UTF-8") with > specialcharacters correctly. > However the mail which is generated doesn't encode the bodytext correctly. > the > weird thing is that when I submit the same URL I gave to the SendMailaction > via > a browser, the character-encoding is correct. > when looking at the following sourcecode, then Bodytext should logically be > encoded with UTF-8 (as everything else is done with UTF-8). However in order > to > work, I had to switch to ISO-8859-1 for this single line. Otherwise the > generated html-mail had strange special characters.. > var cocoonurl = "cocoon:/mailtext/arllink/" + myarl + "?body=" + > java.net.URLEncoder.encode(model.KollegeEmailBodytext,"ISO-8859-1"); > > var mailsender = cocoon.getComponent > (Packages.org.apache.cocoon.mail.MailSender.ROLE); > mailsender.setSmtpHost(cocoon.parameters["eohb_smtp_host"],cocoon.parameters > ["eohb_smtp_user"],cocoon.parameters["eohb_smtp_pwd"]); > mailsender.setTo(model.KollegeEmail); > mailsender.setFrom(cocoon.parameters["eohb_smtp_from"]); > mailsender.setBodyFromSrc(cocoonurl); > mailsender.setSubject("eOHB Link"); > mailsender.setCharset("UTF-8"); > mailsender.setBodyFromSrcMimeType("text/html; charset=utf-8"); > mailsender.sendIt(); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
