#include "smtpclient.h"
#include
#include
#include
#include
#include
#include
#include
enum SMTPCMD{SMTP_EHLO = 0
, SMTP_AUTHLOGIN
, SMTP_MAIL
, SMTP_RCPT
, SMTP_DATA
, SMTP_QUIT};
struct SmtpClientData
{
SmtpClientData()
: hostName("")
, hostPort(0)
, userName("")
, userPassword("")
, sender("")
, receiver("")
, subject("")
, content("")
, attachments("")
, socket(0)
, stream(0)
, totalSize(0)
, sentSize(1)
{
}
QString hostName; // smtp.hikvision.com.cn
unsigned int hostPort; // 25 as usual
QString userName; // test@hikvision.com.cn
QString userPassword; // test
QString sender; // from
QString receiver; // to
QString subject; // abstract title
QString content; // rich text
QStringList attachments;// paths of attachments
QTcpSocket *socket; // smtp socket
QTextStream *stream; // text-stream for socket
qint64 totalSize; // total size of mail containing text and attachments
qint64 sentSize; // size already sent
};
2021-04-20 15:18:54
3KB
qt
邮件发送
1