Diffstat (limited to 'noncore/unsupported/mailit/emailhandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/emailhandler.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp index 03f8a28..f6c6d60 100644 --- a/noncore/unsupported/mailit/emailhandler.cpp +++ b/noncore/unsupported/mailit/emailhandler.cpp @@ -200,13 +200,19 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) } //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To: - if (pos = p.find("TO",':', pos, TRUE) != -1) + if ((pos = p.find("TO",':', 0, TRUE)) != -1) { pos++; mail->recipients.append (p.getString(&pos, 'z', TRUE) ); } - + //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To: + if ((pos = p.find("CC",':', 0, TRUE)) != -1) + { + pos++; + mail->carbonCopies.append (p.getString(&pos, 'z', TRUE) ); + } + if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) { pos++; @@ -434,6 +440,13 @@ int EmailHandler::encodeMime(Email *mail) for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) { newBody += *it + " "; } + + newBody += "\r\nCC: "; + + for (QStringList::Iterator it = mail->carbonCopies.begin(); it != mail->carbonCopies.end(); ++it ) { + newBody += *it + " "; + } + newBody += "\r\nSubject: " + mail->subject + "\r\n"; if (mail->files.count() == 0) { //just a simple mail |