
Using an experiment board that connects to the Internet with WIZ820io (W5200), we conducted an experiment to confirm the operation of short mail transmission described in the manuscript on April 29, 2017.
The Ethernet board was previously reported in my page on Sep. 1, 2017.
If the switch (BUTTON0) is pushed and released, the massage will be send to the preset address using SMTPDemo.c.
<< Sample code of E-mail sender with 5200 >>
(Compiled by the C18 under the large code model on the MPLAB X IDE)
In TCPIPConfig.h, STACK_USE_SMTP_CLIENT, STACK_USE_DNS and STACK_USE_TCP must be defined.
Example above:
NetBIOS Name = PIC18F27J53
Default MAC address = {0x00, 0x04, 0xA3, 0x00, 0x00, 0x00}
Default IP address = 192.168.1.10
Default subnet mast = 255.255.255.0
Default primary DNS = 192.168.1.1
Default secondary DNS = 0.0.0.0
In SMTP.c, a SMTP port must be defined to be appropriate for your Internet Service Provider. In my project, the message submission Port(587) of the SMTP server is used.
In SMTPDemo.c, your data must be set adequately to the arrays bellow.
RAMStringTo[] = ” @ “; <— Destination mail address
RAMStringBody[] = “***”; <— Short character string
SMTPClient.Server.szROM = (ROM BYTE*)”***”;
SMTPClient.Username.szROM = (ROM BYTE*)”***”;
SMTPClient.Password.szROM = (ROM BYTE*)”***”;
SMTPClient.From.szROM = (ROM BYTE*)””SMTP Service” < @ >”; < — Sender mail address
SMTPClient.Subject.szROM = (ROM BYTE*)”***”; <— E-mail tittle
(Set the contract provider’s account, destination email address, email title, and email body in the SMTPDemo.c file. Set the SMTP port in the SMTP.c file.)
<< Summary in Japanese >>
It took me a long time to fix WIZnet ‘s W5200 hardwired TCP / IP driver so that SMTPDemo.c would work, because I’m an amateur, but I’m a professional. Does WIZnet itself think that the W5200 will be actively used in PIC microcomputers? The driver is also a defeated job. To put it the other way around, it has value as a teaching material for amateur crafts.
COMMENTS