This library contains functions for sending mails to smtp mailhost server
For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.
Go to the source code of this file.
Data Structures | |
| struct | _hostinfo |
| struct | _mailheader |
| struct | _userheader |
Defines | |
| #define | MAX_LINE_SIZE 1024 |
| #define | SMTP_VERSION 3 |
| #define | SMTP_MAXATTACHMENTSIZE 5 |
| #define | SMTP_MAXUSERHEADERSIZE 20 |
| #define | SMTP_INSUFFICIENT_MEMORY -1 |
| #define | SMTP_MAILHOST_NOT_FOUND -3 |
| #define | SMTP_FILE_NOT_FOUND -4 |
| #define | SMTP_SOCKET_ERROR -7 |
| #define | SMTP_MAIL_QUEUED -8 |
| #define | SMTP_INVALID_MAILNODE_ADDRESS -9 |
| #define | SMTP_LIBRARY_IS_NOT_CONFIGURED -11 |
| #define | SMTP_STATUS_SUCCESS 0 |
Typedefs | |
| typedef _hostinfo | hostinfo |
| typedef _mailheader | mailheader |
| Structure for standard mail header holds standard mail header values. | |
| typedef _userheader | userheader |
| Structure for user defined mail header contains user header name list and user header value list. | |
Functions | |
| void | smtp_init (void) |
| Initializes smtp library. | |
| void | smtp_sethostinfo (struct _hostinfo *phostinfo) |
| Sets the host information object with smtp library. | |
| void | smtp_setclientsocktimeout (long milli_sec) |
| Sets SMTP client socket timeout value. | |
| long | smtp_getclientsocktimeout (void) |
| Returns the current value for SMTP client socket timeout. | |
| void | smtp_setdefaultheadervalue (struct _mailheader *pmhdr) |
| Sets the default value for standard mail headers. | |
| void | smtp_setuserheaderlist (struct _userheader *pusrhdr) |
| Sets user defined mail header list. | |
| int | smtp_sendmail (struct _mailheader mail_header, char *msg, char *attachmentlist[SMTP_MAXATTACHMENTSIZE], char queuemail_flag, unsigned long *mailnodeaddress) |
| Sends mail to mail host. | |
| int | smtp_removemailfromqueue (unsigned long pmailnode_address) |
| Removes queued mail from mail queue list. | |
| int | smtp_getqueuedmailstatus (unsigned long pmailnode_address) |
| Returns the status of queued mail. | |
|
|
Definition for maximum size of mail header |
|
|
File not found error value
|
|
|
Insufficient memory error value
|
|
|
Invalid mailnode address error value. |
|
|
smtp library is not configured error value, this value will be returned if smtp host information is not configured.
|
|
|
Mail is queued error value
|
|
|
Mail host is not found error value
|
|
|
Definition for maximum number of attachments
|
|
|
Definition for maximum number of user headers
|
|
|
Socket error value
|
|
|
smtp Status success value, this value is returned when operation is completed successfully.
|
|
|
Version number associated with this header file. Should be the same as the version number returned by the smtp_version function.
|
|
|
Structure for host configuration information that has to be registered with smtp library |
|
|
Returns the current value for SMTP client socket timeout. This function returns the current value for SMTP client socket timeout This function is safe to be called from multiple processes at the same time.
|
|
|
Returns the status of queued mail. This function returns the status of mail which was queued by smtp_sendmail.
|
|
|
Initializes smtp library. This function initializes the internal data structures of smtp library. This function should be called first before calling any other functions of smtp library. NOTE: Other libraries don't need to be initialized before smtp library initialization. |
|
|
Removes queued mail from mail queue list. This function removes the mail which was queued by smtp_sendmail.
|
|
||||||||||||||||||||||||
|
Sends mail to mail host. This function sends mail to mailhost. if smtp host IP address is zero, this function uses dns library to get IP address of target mailhost. if mail host is down and application sets queuemail_flag=1, Mail will be queued to resend later. this function uses base64 MIME encryption for sending attachments. it does not use any encryption for message
|
|
|
Sets SMTP client socket timeout value. This function sets SMTP client socket timeout value. The default SMTP client Time out value after initializing smtp library is 30 seconds.
|
|
|
Sets the default value for standard mail headers. This function stores address of mail header structure in smtp library global variable. smtp_sendmail function uses pmhdr value by default, user can override these values by passing valid standard mail header value while calling smtp_sendmail function. NOTE: default mail header value is not mandatory for sending mail. It is optional feature.
|
|
|
Sets the host information object with smtp library. This function stores address of host configuration information structure in smtp library global variable. Then, configures dns library by setting primary and secondary dns server ip addresses. host configuration information is used to connect with SMTP servers.
|
|
|
Sets user defined mail header list. This function stores address of user mail header list structure in smtp library global variable. user defined mail headers will be added while sending mail messages. NOTE: user mail header list is not mandatory for sending mail. It is optional feature.
|
| Copyright 2005 Dallas Semiconductor, Inc.. | Documentation generated by Doxygen. |