Bonjour,
Je souhaite envoyer un mail dans mon programme en C mais j'ai des erreurs d'authentification... Il y a plein de sujet sur le net mais je n'arrive pas à corriger l'erreur.
Voilà ma connexion :
Code:SMTPInfo smtp; smtp.server = "smtp.orange.fr"; SOCKADDR_IN sin; smtp.from = "***@wanadoo.fr"; smtp.to = "***@wanadoo.fr"; smtp.subject = "Test"; HOSTENT *host = gethostbyname(smtp.server); memset(&sin, 0, sizeof(sin)); memcpy(&(sin.sin_addr), host->h_addr, host->h_length); sin.sin_family = AF_INET; sin.sin_port = htons(25);
Voila ce que j'envoi au serveur :
Code:char recvmsg[2000]; char sendmsg[20000]; memset(recvmsg, 0, 2000); recv_to(recvmsg); strcpy(sendmsg, "EHLO smtp.orange.fr\r\n"); send_to(sendmsg); recv_to(recvmsg); char fromtt[30]; char tott[30]; send_to("AUTH LOGIN\r\n"); recv_to(recvmsg); send_to("ID\r\n"); recv_to(recvmsg); send_to("******\r\n"); recv_to(recvmsg); memset(fromtt, 0, 20); strcat(fromtt, "MAIL FROM:<"); strcat(fromtt, smtp->from); strcat(fromtt, ">\r\n"); send_to(fromtt); recv_to(recvmsg); memset(tott, 0, 20); strcat(tott, "RCPT TO:<"); strcat(tott, smtp->to); strcat(tott, ">\r\n"); send_to(tott); recv_to(recvmsg); send_to("DATA"); recv_to(recvmsg); send_to(smtp->subject); recv_to(recvmsg); send_to("TESTTTfff"); recv_to(recvmsg); send_to("QUIT"); recv_to(recvmsg);
Le serveur me répond : Codes d'authentification invalides. Invalid authentification credentals ...[305]
Pourtant mon Identifient est bon.
Merci pour votre aide !
-----