【文件属性】:
文件名称:qt简单的邮件发送客户端
文件大小:3KB
文件格式:RAR
更新时间:2014-03-10 04:02:09
qt 邮件发送
#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
};
【文件预览】:
smtpclient.cpp
smtpclient.h