From 2f8026dc5bb17e7fecf126070481e34a20485b67 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sun, 23 May 2010 16:18:00 +0000 Subject: Improved automatic encoding selection. Added helper functions on body for setting contents, type, charset and encoding. --- src/plainTextPart.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/plainTextPart.cpp') diff --git a/src/plainTextPart.cpp b/src/plainTextPart.cpp index 7a674e79..15bcb5eb 100644 --- a/src/plainTextPart.cpp +++ b/src/plainTextPart.cpp @@ -63,13 +63,10 @@ void plainTextPart::generateIn(ref /* message */, ref pare ref part = vmime::create (); parent->getBody()->appendPart(part); - // Set header fields - part->getHeader()->ContentType()->setValue(mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN)); - part->getHeader()->ContentType().dynamicCast ()->setCharset(m_charset); - part->getHeader()->ContentTransferEncoding()->setValue(encoding(encodingTypes::QUOTED_PRINTABLE)); - // Set contents - part->getBody()->setContents(m_text); + part->getBody()->setContents(m_text, + mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN), m_charset, + encoding::decide(m_text, m_charset, encoding::USAGE_TEXT)); } -- cgit v1.2.3