News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

SendMail and smtp.gmail.com

Started by 0x401000, June 04, 2008, 10:54:52 PM

Previous topic - Next topic

0x401000

Somebody already had experience in writing Sendmail programm for smtp.gmail.com ?  ::)  Help with an example please :'(

Tedd

Assuming it actually conforms to (e)smtp, what you need to do is connect to "smtp.gmail.com" on port 25, then send the following:

db "HELO your_account@gmail.com",13,10
..then receive and check the reply (if it says okay, continue, otherwise disconnect and show error)..

then send:
db "MAIL FROM:your_account@gmail.com",13,10
..receive reply, check, etc..

db "RCPT TO:someone_else@their.email.com",13,10
..receive reply..

db "DATA",13,10
..receive reply..

db "From: ""your name"" <your_account@gmail.com>",13,10
db "To: ""another person"" <someone_else@their.email.com>",13,10
db "Subject: It's an email!",13,10
db 13,10
db "This is an email.",13,10
db "It doesn't say much.",13,10
db "But no-one really cares.",13,10
db 13,10
db "[mail ends with a single '.' on a line by itself - this dot doesn't appear in the mail when received.]",13,10
db ".",13,10

..receive reply..

Done. Disconnect.



Though it's likely you'll need to connect through a secure socket and authenticate, so the above may not work :bdg
No snowflake in an avalanche feels responsible.

0x401000

I can lay out a code ordinary sendings. It is a question about smtp.google.com. At them special authorization for this reason I ask  ::) There other order of sending

0x401000

Quote from: Tedd on June 05, 2008, 11:08:02 AM

Though it's likely you'll need to connect through a secure socket and authenticate, so the above may not work :bdg


Indeed

PBrennick

The smtp protocolwill not work with GMAIL. I have tried. And it is beyond me as to how to understand the setup of ESMTP. I read all the docs, got a headache and then deleted the code; in that order. By the way neither protocol will work with GMAIL as it is not that type of mail server (secure or otherwise.)

Still, anyone have any luck with ESMTP?

Paul
The GeneSys Project is available from:
The Repository or My crappy website

0x401000

Quote from: PBrennick on June 06, 2008, 08:59:01 PM
The smtp protocolwill not work with GMAIL. I have tried. And it is beyond me as to how to understand the setup of ESMTP. I read all the docs, got a headache and then deleted the code; in that order. By the way neither protocol will work with GMAIL as it is not that type of mail server (secure or otherwise.)

Still, anyone have any luck with ESMTP?

Paul

secure connection there. What to do I do not know  :eek

xmetal

Gmail requires clients to use both TLS layering as well as authentication Gmail Help: Configuring other mail clients

Hence, after a successful EHLO command-reply sequence, a client should issue the STARTTLS command, followed by an AUTH command.

You can use the OpenSSL library to implement the TLS support in your SMTP client. I used the pre-compiled OpenSSL library binaries from the Win32 OpenSSL Installation Project for my own SMTP client API.

And as far as the authentication goes, I simply used the PLAIN authentication mechanism, which is fine since the SMTP is layered over TLS.

0x401000