Client SMTP et authentification
Bonjour,
J'essaye de faire un petit client minimaliste pour envoyer un mail. Que l'utilisateur n'ai qu'a entrer un minimum de chose pour envoyer le mail a un contact pre defini.
Mais... ça ne marche pas. Je ne sais pas comment m'authentifier déjà.
Voila le code pour le moment :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
socket->abort();
socket->connectToHostEncrypted("smtp.mail.yahoo.fr", 465);
t = new QTextStream(socket);
QString exp = ui->lineEdit->text();
QString dest = ui->lineEdit_2->text();
t = new QTextStream(socket);
*t << "EHLO localhost\r\n";
t->flush();
*t << "MAIL FROM: <" + exp + ">\r\n";
t->flush();
*t << "RCPT TO: <" + dest + ">\r\n";
t->flush();
*t << "DATA" + ui->textEdit->toPlainText() + ".\r\n";
t->flush();
*t << "QUIT\r\n";
t->flush();
ui->textEdit->setText("envoye"); |
Et j'obtiens cela :
Code:
1 2 3 4
|
220 smtp143.mail.ukl.yahoo.com ESMTP
250-smtp143.mail.ukl.yahoo.com
530 authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html |
Si quelqu'un peu m'aider un peu svp, merci d'avance,
Très cordialement,