File indexing completed on 2024-05-12 05:21:35
0001 /* 0002 SPDX-FileCopyrightText: 2010 BetterInbox <contact@betterinbox.com> 0003 SPDX-FileContributor: Christophe Laveault <christophe@betterinbox.com> 0004 SPDX-FileContributor: Gregory Schlomoff <gregory.schlomoff@gmail.com> 0005 0006 SPDX-License-Identifier: LGPL-2.1-or-later 0007 */ 0008 0009 #pragma once 0010 0011 #include "ksmtp_export.h" 0012 0013 #include "job.h" 0014 0015 namespace KSmtp 0016 { 0017 class SendJobPrivate; 0018 /** 0019 * @brief The SendJob class 0020 */ 0021 class KSMTP_EXPORT SendJob : public Job 0022 { 0023 Q_OBJECT 0024 Q_DECLARE_PRIVATE(SendJob) 0025 0026 public: 0027 explicit SendJob(Session *session); 0028 0029 /** 0030 * Set the sender email address 0031 */ 0032 void setFrom(const QString &from); 0033 0034 /** 0035 * Add recipients. 0036 * 0037 */ 0038 void setTo(const QStringList &to); 0039 0040 /** 0041 * Add recipients. 0042 */ 0043 void setCc(const QStringList &cc); 0044 0045 /** 0046 * Add recipients. 0047 */ 0048 void setBcc(const QStringList &bcc); 0049 0050 /** 0051 * Set the actual message data. 0052 */ 0053 void setData(const QByteArray &data); 0054 0055 /** 0056 * Returns size of the encoded message data. 0057 */ 0058 [[nodiscard]] int size() const; 0059 0060 /** 0061 * Set Delivery Status Notification. 0062 */ 0063 void setDeliveryStatusNotification(bool b); 0064 0065 protected: 0066 void doStart() override; 0067 void handleResponse(const ServerResponse &r) override; 0068 }; 0069 }