of course there is no check done in this code, just add the check for server answer, and it works!

 Socket = HttpConnect ("smtp.gmail.com", 465);
 read = SSL_set_fd(ssl, Socket);
 read = SSL_connect(ssl);
 read = SSL_get_error(ssl, read);
 read = SSL_read(ssl, reply, sizeof(reply));
 strcpy (reply, "EHLO smtp\n");
 SSL_write (ssl, reply, strlen (reply));
 read = SSL_read(ssl, reply, sizeof(reply));
 strcpy (reply, "AUTH LOGIN\n");
 SSL_write (ssl, reply, strlen (reply));
 read = SSL_read(ssl, reply, sizeof(reply));
 strcpy (reply, "encoded_base64_username\n");
 SSL_write (ssl, reply, strlen (reply));
 read = SSL_read(ssl, reply, sizeof(reply));
 strcpy (reply, "encoded_base64_password\n");
 SSL_write (ssl, reply, strlen (reply));
 read = SSL_read(ssl, reply, sizeof(reply));
 strcpy (reply, "MAIL FROM: <[EMAIL PROTECTED]>\n");
 SSL_write (ssl, reply, strlen (reply));
 read = SSL_read(ssl, reply, sizeof(reply));

 strcpy (reply, "RCPT TO: <[EMAIL PROTECTED]");
 SSL_write (ssl, reply, strlen (reply));
 read = SSL_read(ssl, reply, sizeof(reply));

 strcpy (reply, "DATA\n");
 SSL_write (ssl, reply, strlen (reply));
 read = SSL_read(ssl, reply, sizeof(reply));

 sendc ("From: [EMAIL PROTECTED]");
 sendc ("To: [EMAIL PROTECTED]");
 sendc ("Subject: Test\n");
 sendc ("Sender: any@yahoo.com\n");
 sendc ("Mime-Version: 1.0\n");
 sendc ("Content-Type: text/plain; charset=\"iso-8859-1\"\n");
 sendc ("Date: Tue, 02 Jan 2005 13:43:41 -0500\n\n");
 sendc ("This is the first line\nThen the second one\nThe next one is empty\n");
 sendc ("\x0d\x0a.\x0d\x0a");
 read = SSL_read(ssl, reply, sizeof(reply));
 sendc ("QUIT\n");
 read = SSL_read(ssl, reply, sizeof(reply));

 SSL_shutdown(ssl);
 SSL_free(ssl);
 SSL_CTX_free (ctx);


Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.

Reply via email to