|
Part 3: Hot-Wiring the System
by Fred Eady
Start ı E-Mail
101 ı Automatic Transmission ı Mail
Delivered ı Sources and PDF
AUTOMATIC TRANSMISSION
You donıt know it yet, but youıve graduated.
You have a solid knowledge of how to send a simple e-mail by hand.
To make the e-mail trick work on the S-7600A/PIC16F877 Internet Engine,
all you have to do is a knowledge transfer.
From my previous articles, you already
know about the S-7600A/PIC16F877 Internet Engine hardware and bootloader
and how they work together. So, you can do a big GOTO in the source
code you see in Listing
1.
Letıs start at the comment // SMTP
code begins here. All of the code up to this point has been gathering
information needed to connect, and then using that information to
establish a PPP connection to my ISP. To connect to your ISP, simply
put your ISPıs IP address in place of mine in the source code. The
destination port is already set for 0x19, the well-known SMTP port.
Your ISP phone number, log on ID, and password are prompted for in
the beginning of the program.
Just like Photo 1, the first thing that
should happen after a successful connection is the first 220 howdy
message. Because Iım originating from a dial-up connection to ddi.digital.net,
my HELO command contains an argument of ddi.digital.net. I only need
to check the first four characters of any reply to know if things
are good or bad. Actually, the first three would suffice, but it was
a bit more logical for me to include the space following the reply
to be absolutely sure I had parsed the reply code. One RFC says you
can do it with a single character, and another tells you the space
after the three digits is important. So, I took both RFCsı advice.
I still check the first character, and I also look for the space.
Like the IP address, youıll need to change
the MAIL and RCPT arguments to match your mailıs source and destination.
By now, youıve got the idea. The PIC program is no more than a copy
of the manual process I performed earlier. Only this time, the PIC
is doing the keyboard work. All you have to do to get going for yourself
is to literally fill in the blanks in Listing
1.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ıCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |