Diffstat (limited to 'noncore/net/mailit/emailhandler.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mailit/emailhandler.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp index 03f8a28..f6c6d60 100644 --- a/noncore/net/mailit/emailhandler.cpp +++ b/noncore/net/mailit/emailhandler.cpp @@ -200,12 +200,18 @@ 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) { @@ -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 |