MarshallSoft

Using SEE with GMAIL

If you have an account at GMAIL, it is possible to send and receive email using a SSL/TLS enabled proxy server such as the (free) STUNNEL (http://www.stunnel.org/) proxy server.

The data flow for sending email is:

SEE_Program --> STUNNEL --> smtp.gmail.com --> recipient

and the data flow for receiving email is:

SEE_Program <-- STUNNEL <-- pop.gmail.com <-- your_Gmail

Also see Gmail Topic 12567

Configuring Gmail for Use

To access you Gmail email from your SEE program you must first enable POP3 access in Gmail.

To enable POP in your Gmail account:

Downloading the STUNNEL Proxy Server

The next step is installing a SSL/TLS enabled proxy server. For example, consider using the (free) STUNNEL server. Go to www.stunnel.org/download/binaries.html and download the "Stunnel Win32 Binaries". Install into an empty directory, say for example C:\STUNNEL

Configuring the Proxy Server for Sending Email

In order to send email, you must create a SMTP configuration file for use by STUNNEL. Create a file named SMTPgmail.txt with the following content:

; SMTP configuration for SEE/Gmail
output = SMTPgmail.log
taskbar = yes
cert = stunnel.pem
client = yes
; run your SEE program after starting STUNNEL
[ssmtp]
accept = 10.0.0.1:8025
connect = smtp.gmail.com:465

Replace 10.0.0.1 above with the name (or IP address) of your machine. Do not use 127.0.0.1.

To find your machine name, click "START", "Control Panel", "System", "Computer Name". To find the IP address of your machine, type IPCONFIG in a Command Window.

If you have a certificate in PEM format that you would prefer to use, copy it to the STUNNEL directory and replace "stunnel.pem" with your PEM certificate above.

Configuring the Proxy Server for Receiving Email

In order to receive email, you must create a POP3 configuration file for use by STUNNEL. Create a file named POP3gmail.txt with the following content:

; POP3 configuration for SEE/Gmail
output = POP3gmail.log
taskbar = yes
cert = stunnel.pem
client = yes
; run your SEE program after starting STUNNEL
[spop3]
accept = 10.0.0.1:8110
connect = pop.gmail.com:995

Replace 10.0.0.1 above with the name (or IP address) of your machine. Do not use 127.0.0.1.

To find your machine name, click "START", "Control Panel", "System", "Computer Name". To find the IP address of your machine, type IPCONFIG in a Command Window.

If you have a certificate in PEM format that you would prefer to use, copy it to the STUNNEL directory and replace "stunnel.pem" with your PEM certificate above.

Creating a SEE Program for Sending Email via GMail

The SEE logic for sending an email via STUNNEL & Gmail is:

-- attach SEE
seeAttach
-- set SMTP proxy port to 8025
seeIntegerParam(0, SEE_SMTP_PORT, 8025)
-- enable ESMTP authentication
seeIntegerParam(0, SEE_ENABLE_ESMTP, 1)
-- specify user name
seeStringParam(0, SEE_SET_USER, "YOUR-ACCOUNT@gmail.com")
-- specify password for authentication
seeStringParam(0, SEE_SET_SECRET, "YOUR-PASSWORD")
-- connect to SMTP server
seeSmtpConnect
-- send email
seeSendEmail
-- close & release
seeClose
seeRelease

Download the GmailViaProxy.c example program.

Creating a SEE Program for Receiving Email via GMail

The SEE logic for receiving an email via STUNNEL & Gmail is:

-- attach SEE
seeAttach
-- set POP3 proxy port to 8110
seeIntegerParam(0, SEE_POP3_PORT, 8110)
-- connect to POP3 server using your user name & password
seePop3Connect
-- get email headers, download email, etc.
seeGetEmailFile, etc.
-- close & release
seeClose
seeRelease

Download the GmailStatusViaProxy.c example program.

Sending Email Via Gmail

Start STUNNEL at the command line by typing

stunnel SMTPgmail.txt

Start your SEE program that sends email, such as the GmailViaProxy example program.

Downloading Email Via Gmail

Start STUNNEL at the command line by typing

stunnel POP3gmail.txt

Start your SEE program that downloads email, such as the GmailStatusViaProxy example program.


HOME