Automatic Email Sending using Gmail

Free service from Gmail is great.  Gmail open up its SMTP server and allow program to connect to their SMTP server to send automated email.

Google does not accept ordinary SMTP traffic as it is not encrypted and prone to sniffing of the username and password.  Therefore, we cannot connect to Google SMTP server directly using SMTP command, such as Blat Mail.  We need to build a secure channel.

We use stunnel to create the encrypted tunnel.  The BLAT mail then connects to localhost:10025 which stunnel is listening.  stunnel receives the request from BLAT, encrypts the traffic and relay it to  For the return traffic from gmail, stunnel will do the decryption vice versa.

You may also refer to this site for a description of stunnel installation.

accept  =
connect =

;accept =
;connect =

Windows Batch file to send SMTP email
D:\BLATMAIL\blat.exe -to -f -server -u -pw YourPassword -subject "Email Test" -body "Email Test. This is a test email"


Popular Posts