I'm almost finished. The program is written, but I have not found the time to test it.
To test an email server, I used putty.
Here's communications with the server.
Code:
EHLO
AUTH LOGIN here should be base64 emall http://www.webpan.com/Customers/Email/base64_conversion.htm
334 UGFzc3dvcmQ6 '=password
enter password in base64
235 Authentication succeeded
MAIL FROM: <123@123>
250 OK
RCPT TO: <1123@123>
250 Accepted
DATA
354 Enter message, ending with "." on a line by itself
From: <123@123>
To: <1123@123>
Subject: Hello
Date: 17:05:41
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
This is a simple Message
. 'end of mesage, dot in singl
250 OK id=1Pch7Q-0003zQ-BX
First you need to set up gprs conn.
then
Code:
serout2 tx,84,["AT+CIPSTART=0,",34,"TCP",34,",",34,"mail.123",34,",","26",13,10]
CALL WAIT_OK
IF OK=0 THEN GOTO send
serin2 rx,84,lag,ERR_GPRS,[wait("0, CONNECT OK")]
serin2 rx,84,lag,err_mail,[wait("220")]
pause 700 ' wait for comments
serout2 tx,84,["AT+CIPSEND=0",13,10]
CALL WAIT_V 'wait for >
IF OK=0 THEN GOTO ERR_GPRS
pause 10
serout2 tx,84,["EHLO",13,10]
pause 5
serout2 tx,84,[26]
CALL WAIT_SEND_OK
serin2 rx,84,lag,err_mail,[wait("250")]
pause 700
serout2 tx,84,["AUTH LOGIN email in base64",13,10]
etc...
Base64 in vb6 application, I use to set email, server, time between e mail, and other device parameters.
With a slightly different message body, you can send attachment.
EDIT:
I used the same principle for ftp. Works over a month without a single error
Bookmarks