aboutsummaryrefslogtreecommitdiffstats
path: root/src/plainTextPart.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2010-05-23 16:18:00 +0000
committerVincent Richard <[email protected]>2010-05-23 16:18:00 +0000
commit2f8026dc5bb17e7fecf126070481e34a20485b67 (patch)
tree74625e9c08910c4db6ed19c341246aa1a922a494 /src/plainTextPart.cpp
parentFileSystemFactory is now a ref. (diff)
downloadvmime-2f8026dc5bb17e7fecf126070481e34a20485b67.tar.gz
vmime-2f8026dc5bb17e7fecf126070481e34a20485b67.zip
Improved automatic encoding selection. Added helper functions on body for setting contents, type, charset and encoding.
Diffstat (limited to 'src/plainTextPart.cpp')
-rw-r--r--src/plainTextPart.cpp9
1 files changed, 3 insertions, 6 deletions
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 <bodyPart> /* message */, ref <bodyPart> pare
ref <bodyPart> part = vmime::create <bodyPart>();
parent->getBody()->appendPart(part);
- // Set header fields
- part->getHeader()->ContentType()->setValue(mediaType(mediaTypes::TEXT, mediaTypes::TEXT_PLAIN));
- part->getHeader()->ContentType().dynamicCast <contentTypeField>()->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));
}