MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / internalSendMessage

Method internalSendMessage

src/core/smtp/MCSMTPSession.cpp:702–830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700}
701
702void SMTPSession::internalSendMessage(Address * from, Array * recipients, Data * messageData,
703 SMTPProgressCallback * callback, ErrorCode * pError)
704{
705 clist * address_list;
706 int r;
707 bool sendingCancelled;
708
709 if (from == NULL) {
710 * pError = ErrorNoSender;
711 return;
712 }
713 if ((recipients == NULL) || (recipients->count() == 0)) {
714 * pError = ErrorNoRecipient;
715 return;
716 }
717
718 if (!this->mOutlookServer) {
719 messageData = dataWithFilteredBcc(messageData);
720 }
721
722 mProgressCallback = callback;
723 bodyProgress(0, messageData->length());
724
725 MCLog("setup");
726
727 MCLog("connect");
728 loginIfNeeded(pError);
729 if (* pError != ErrorNone) {
730 goto err;
731 }
732
733 CANCEL_LOCK();
734 sendingCancelled = mSendingCancelled;
735 CANCEL_UNLOCK();
736 if (sendingCancelled) {
737 goto err;
738 }
739
740 CAN_CANCEL_LOCK();
741 mCanCancel = true;
742 CAN_CANCEL_UNLOCK();
743
744 // disable DSN feature for more compatibility
745 mSmtp->esmtp &= ~MAILSMTP_ESMTP_DSN;
746
747 address_list = esmtp_address_list_new();
748 for(unsigned int i = 0 ; i < recipients->count() ; i ++) {
749 Address * addr = (Address *) recipients->objectAtIndex(i);
750 esmtp_address_list_add(address_list, (char *) MCUTF8(addr->mailbox()), 0, NULL);
751 }
752 MCLog("send");
753 if ((mSmtp->esmtp & MAILSMTP_ESMTP_PIPELINING) != 0) {
754 r = mailesmtp_send_quit_no_disconnect(mSmtp, MCUTF8(from->mailbox()), 0, NULL,
755 address_list,
756 messageData->bytes(), messageData->length());
757 CAN_CANCEL_LOCK();
758 mCanCancel = false;
759 CAN_CANCEL_UNLOCK();

Callers

nothing calls this directly

Calls 7

objectAtIndexMethod · 0.80
bytesMethod · 0.80
locationOfStringMethod · 0.80
hasPrefixMethod · 0.80
countMethod · 0.45
lengthMethod · 0.45
mailboxMethod · 0.45

Tested by

no test coverage detected