Diffstat (limited to 'noncore/unsupported/mailit/emailhandler.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/emailhandler.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp index 5b8bda1..06e978d 100644 --- a/noncore/unsupported/mailit/emailhandler.cpp +++ b/noncore/unsupported/mailit/emailhandler.cpp | |||
@@ -62,25 +62,27 @@ EmailHandler::EmailHandler() | |||
62 | 62 | ||
63 | //relaying size information | 63 | //relaying size information |
64 | connect(popClient, SIGNAL(currentMailSize(int)), | 64 | connect(popClient, SIGNAL(currentMailSize(int)), |
65 | this, SIGNAL(currentMailSize(int)) ); | 65 | this, SIGNAL(currentMailSize(int)) ); |
66 | connect(popClient, SIGNAL(downloadedSize(int)), | 66 | connect(popClient, SIGNAL(downloadedSize(int)), |
67 | this, SIGNAL(downloadedSize(int)) ); | 67 | this, SIGNAL(downloadedSize(int)) ); |
68 | } | 68 | } |
69 | 69 | ||
70 | void EmailHandler::sendMail(QList<Email> *mailList) | 70 | void EmailHandler::sendMail(QList<Email> *mailList) |
71 | { | 71 | { |
72 | Email *currentMail; | 72 | Email *currentMail; |
73 | QString temp; | 73 | QString temp; |
74 | QString userName = mailAccount.name; | 74 | QString userName = QString::null; |
75 | // not supported by ALL SMTP servers in the MAIL From field | ||
76 | // userName = "\""+mailAccount.name+"\""; | ||
75 | userName += " <" + mailAccount.emailAddress + ">"; | 77 | userName += " <" + mailAccount.emailAddress + ">"; |
76 | 78 | ||
77 | for (currentMail = mailList->first(); currentMail != 0; | 79 | for (currentMail = mailList->first(); currentMail != 0; |
78 | currentMail = mailList->next()) { | 80 | currentMail = mailList->next()) { |
79 | 81 | ||
80 | if (encodeMime(currentMail) == 0) { | 82 | if (encodeMime(currentMail) == 0) { |
81 | smtpClient->addMail(userName, currentMail->subject, | 83 | smtpClient->addMail(userName, currentMail->subject, |
82 | currentMail->recipients, currentMail->rawMail); | 84 | currentMail->recipients, currentMail->rawMail); |
83 | } else { //error | 85 | } else { //error |
84 | temp = tr("Could not locate all files in \nmail with subject: ") + | 86 | temp = tr("Could not locate all files in \nmail with subject: ") + |
85 | currentMail->subject; | 87 | currentMail->subject; |
86 | temp += tr("\nMail has NOT been sent"); | 88 | temp += tr("\nMail has NOT been sent"); |
@@ -433,28 +435,31 @@ int EmailHandler::parse64base(char *src, char *bufOut) { | |||
433 | bufOut[2] = bufOut[2] | z; //third byte retrieved | 435 | bufOut[2] = bufOut[2] | z; //third byte retrieved |
434 | processed++; | 436 | processed++; |
435 | } | 437 | } |
436 | } | 438 | } |
437 | return processed; | 439 | return processed; |
438 | } | 440 | } |
439 | 441 | ||
440 | int EmailHandler::encodeMime(Email *mail) | 442 | int EmailHandler::encodeMime(Email *mail) |
441 | { | 443 | { |
442 | 444 | ||
443 | QString fileName, fileType, contentType, newBody, boundary; | 445 | QString fileName, fileType, contentType, newBody, boundary; |
444 | Enclosure *ePtr; | 446 | Enclosure *ePtr; |
447 | QString userName; | ||
445 | 448 | ||
446 | QString userName = mailAccount.name; | 449 | if ( ! mailAccount.name.isEmpty() ) { |
447 | if (userName.length()>0) //only embrace it if there is a user name | 450 | userName = "\"" + mailAccount.name + "\" <" + mailAccount.emailAddress + ">"; |
448 | userName += " <" + mailAccount.emailAddress + ">"; | 451 | } else { |
452 | userName = "<" + mailAccount.emailAddress + ">"; | ||
453 | } | ||
449 | 454 | ||
450 | //add standard headers | 455 | //add standard headers |
451 | newBody = "From: " + userName + "\r\nTo: "; | 456 | newBody = "From: " + userName + "\r\nTo: "; |
452 | for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) { | 457 | for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) { |
453 | newBody += *it + " "; | 458 | newBody += *it + " "; |
454 | } | 459 | } |
455 | 460 | ||
456 | newBody += "\r\nCC: "; | 461 | newBody += "\r\nCC: "; |
457 | 462 | ||
458 | for (QStringList::Iterator it = mail->carbonCopies.begin(); it != mail->carbonCopies.end(); ++it ) { | 463 | for (QStringList::Iterator it = mail->carbonCopies.begin(); it != mail->carbonCopies.end(); ++it ) { |
459 | newBody += *it + " "; | 464 | newBody += *it + " "; |
460 | } | 465 | } |