void form::on_pushButton_pressed(){ SmtpAuthData smtpAuthData; SmtpAuthData::Data data; // your email address data.email = "От кого"; // login for your email account data.login = "Логин"; // name which will be shown in From: line(optional) //data.name = QString::fromLocal8Bit(""); // password for auth on email account data.password = "Пароль"; // port for host 587 default //data.port = ""; // ssl support //data.enableSsl = true; smtpAuthData.rewriteData(data); Letter letter(smtpAuthData); QString secondFile(""); QStringList filesList; filesList << secondFile; QString receivers = QString::fromLocal8Bit("Кому"); //QString blindCopyReceivers = ""; // choice letter encoding //letter.set_encoding(""); letter.set_receivers(receivers); //letter.set_blindCopyReceivers(blindCopyReceivers); //letter.set_subject(QString::fromLocal8Bit("")); //letter.set_attachement(filesList); letter.set_text(QString::fromLocal8Bit("Проверка")); // send letter letter.send();}
Email at -> "От кого" Ready read -> 31 Block size -> 31 Server request -> "220 smtp9.mail.ru ESMTP ready" Ready read -> 88 Block size -> 88 Server request -> "250 STARTTLS" Ready read -> 18 Block size -> 18 Server request -> "334 VXNlcm5hbWU6" Ready read -> 18 Block size -> 18 Server request -> "334 UGFzc3dvcmQ6" Ready read -> 30 Block size -> 30 391 Server request -> "235 Authentication succeeded" Ready read -> 8 Block size -> 8 Emails to -> "Кому" Server request -> "250 OK" Ready read -> 14 Block size -> 8 Server request -> "250 Accepted" Ready read -> 56 Block size -> 56 Server request -> "354 Enter message, ending with "." on a line by itself" Ready read -> 28 Block size -> 28 Server request -> "250 OK id=1SYEZa-0001Ad-Sr"
Email at -> "От кого"
char *email = mail.toAscii().data();