Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Include Files

Wherever you want to use µC/SMTPc, you should include the following header:

Include file
Description
Source/smtp-c.hContains SMTPc API definitions

Module initialization

µC/SMTPc does not require to be initialized. Although, if you want to use the DNS features, µC/DNSc shall be properly initialized.

Create an email

To create an email, you will need to create an instance of SMTPc_MSG.

   
*FromSMTPc_MBOX 
*ToArray[SMTPc_CFG_MSG_MAX_TO]SMTPc_MBOX 
*ReplyToSMTPc_MBOX 
*SenderSMTPc_MBOX 
*CCArray [SMTPc_CFG_MSG_MAX_CC]SMTPc_MBOX 
*BCCArray [SMTPc_CFG_MSG_MAX_BCC]SMTPc_MBOX 
MsgID [SMTPc_MSG_MSGID_LEN]CPU_CHAR 
MIMEMsgHdrStructSMTPc_MIME_ENTITY_HDR 
*SubjectCPU_CHAR 
*AttachArray[SMTPc_CFG_MSG_MAX_ATTACH]SMTPc_ATTACH 
*ContentBodyMsgCPU_CHAR 
ContentBodyMsgLen CPU_INT32U  

 

This must be first initialized with the function SMTPc_SetMsg(). You will need also to create several instance of SMTPc_MBOX to populate your SMTPc_MSG. SMTPc_MBOX is a mailbox that define the adresse and the name if a sender (FROM) or a recipient( TO,CC and BCC). SMTPc_SetMbox() is a tool to populate the field of the mailbox. 

Function name
Description
SMTPc_SetMsg() 
SMTPc_SetMbox() 

 

Send an email

Function name
Description
SMTPc_SendMail()Process all the steps to send an email.


Shell reference

Prerequisite

µC/TCP-IP command module.

Include Files

Wherever you want to use initialize the command in µC/Shell, you should include the following header:

Include file
Description
Cmd/dns-c_cmd.hContains DNSc Command definitions

API

Function name
Description
DNScCmd_Init()Function to load DNS client command into shell.

Command reference

Command
Description
Argument
Usage example
dns_get_hostResolve a host name. Will printout all address retrieved for an host.Host name.dns_get_host micrium.com
dns_server_setConfigure the default server.server ip address.dns_server_set 8.8.8.8
dns_cache_clrClear all host of the DNS cachenone.dns_cache_clr
dns_helpPrint helpnonedns_help
  • No labels