NetBurner 3.5.0
PDF Version |
|
Topics | |
MIME Content Types | |
SMTP Error Codes | |
SSL SMTP Functions | |
Functions | |
int | SendMail (IPADDR smtp_server, PCSTR userid, PCSTR from_addr, PCSTR to_addr, PCSTR subject, PCSTR textbody) |
Send an email message. The function will open a TCP connection to the specified SMTP server, create a message based on the parameters, and send the message. | |
int | SendMailAuth (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR to_addr, PCSTR subject, PCSTR textbody) |
Send an email message with plain text authentication. The function will open a TCP connection to the specified SMTP server, create a message based on the parameters, and send the message. | |
int | SendMailEx (IPADDR smtp_server, PCSTR userid, PCSTR from_addr_rev_path, PCSTR from_addr_memo_hdr, PCSTR to_addr, PCSTR subject, PCSTR textbody) |
Send an email message function, extended version. | |
int | IsMailError () |
Returns the error status of the last send mail transaction. | |
void | PrintNBError (int fd=0) |
If an error occurred, prints the error information received from the SMTP server. | |
void | PrintServerLog (int fd=0) |
Prints the server log of the last send mail transaction. | |
int | SendMailAuthStartMIME (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR to_addr, PCSTR subject, int &fd) |
Start a Multi-purpose Internet Mail Extension (MIME)session. | |
int | SendMailAuthAddMIME (int fd, int ContentType, const char *pContent, const char *FileName) |
Add a MIME part or attachment to an open MIME Session. | |
int | SendMailAuthEndMIME (int fd, PCSTR userid) |
Send a MIME email message and close the SMTP session. | |
enum | CONTENT_TYPE_ENUM { CONTENT_TYPE_PLAIN_TEXT , CONTENT_TYPE_PLAIN_TEXT_ATTACH , CONTENT_TYPE_BINARY_ATTACH , CONTENT_TYPE_HTML_DECOMP , CONTENT_TYPE_END } |
SMTP MIME Conetnet Types. More... | |
#include< mailto.h >
Send emails using the SMTP specification. The Send Mail functions provide a variety of sending options for simple sending an email, or sending with authentication. The IsMailError function is used to check for errors after an email is sent.
enum CONTENT_TYPE_ENUM |
#include <mailto.h>
SMTP MIME Conetnet Types.
int IsMailError | ( | ) |
#include <mailto.h>
Returns the error status of the last send mail transaction.
void PrintNBError | ( | int | fd = 0 | ) |
#include <mailto.h>
If an error occurred, prints the error information received from the SMTP server.
If an error occurs when sending an email, the system will record the error information received from the SMTP server. The information is only valid for the last transaction.
fd | If no parameter is specified information will be sent to stdout. Otherwise it will be sent to the specified file descriptor. |
void PrintServerLog | ( | int | fd = 0 | ) |
#include <mailto.h>
Prints the server log of the last send mail transaction.
The results of each send mail transaction are logged to a buffer. This function will send the results of the last transaction to stdout, or the specified file descriptor. The information is only valid for the last transaction.
fd | If no parameter is specified information will be sent to stdout. Otherwise it will be sent to the specified file descriptor. |
int SendMail | ( | IPADDR | smtp_server, |
PCSTR | userid, | ||
PCSTR | from_addr, | ||
PCSTR | to_addr, | ||
PCSTR | subject, | ||
PCSTR | textbody ) |
#include <mailto.h>
Send an email message. The function will open a TCP connection to the specified SMTP server, create a message based on the parameters, and send the message.
smtp_server | IP address of the destination SMTP server. |
userid | ASCII string representing the RFC 931 identification. |
from_addr | "From" email address |
to_addr | Destination email address |
subject | Email subject |
textbody | Body of email message |
int SendMailAuth | ( | IPADDR | smtp_server, |
PCSTR | userid, | ||
PCSTR | pass, | ||
PCSTR | from_addr, | ||
PCSTR | to_addr, | ||
PCSTR | subject, | ||
PCSTR | textbody ) |
#include <mailto.h>
Send an email message with plain text authentication. The function will open a TCP connection to the specified SMTP server, create a message based on the parameters, and send the message.
Send an email message with SMTP plain text authentication per RFC 931. The function will open a TCP connection to the specified SMTP server, authenticate the connection with the specified username and password, create a message based on the parameters, and send the message.
smtp_server | IP address of the destination SMTP server. |
userid | ASCII string representing the RFC 931 identification. |
pass | ASCII string to provide for AUTH identification. |
from_addr | "From" email address |
to_addr | Destination email address |
subject | Email subject |
textbody | Body of email message |
int SendMailAuthAddMIME | ( | int | fd, |
int | ContentType, | ||
const char * | pContent, | ||
const char * | FileName ) |
#include <mailto.h>
Add a MIME part or attachment to an open MIME Session.
Must only be called for an open session started with SendMailAuthStartMIME(). It can be called as many times as needed to add each MIME part or attachment to the message.
fd | The file descriptor of the open MIME session. |
ContentType | The MIME content type, such as: CONTENT_TYPE_PLAIN_TEXT, CONTENT_TYPE_PLAIN_TEXT_ATTACH, CONTENT_TYPE_BINARY_ATTACH. |
*pContent | Pointer to the content to add. |
*FileName | File name for the attachment. |
int SendMailAuthEndMIME | ( | int | fd, |
PCSTR | userid ) |
#include <mailto.h>
Send a MIME email message and close the SMTP session.
Must only be called for an open session started with SendMailAuthStartMIME().
fd | The file descriptor of the open MIME session. |
*userid | The user ID that was used by SendMailAuthStartMIME() to open the session. |
int SendMailAuthStartMIME | ( | IPADDR | smtp_server, |
PCSTR | userid, | ||
PCSTR | pass, | ||
PCSTR | from_addr, | ||
PCSTR | to_addr, | ||
PCSTR | subject, | ||
int & | fd ) |
#include <mailto.h>
Start a Multi-purpose Internet Mail Extension (MIME)session.
Start a MIME session with plain text password authentication. This function will open a TCP connection to the SMTP server, authenticate, then return while leaving the TCP connection open. The Session file descriptor is returned in the "int &fd" reference variable. This function must be called before any other SendMail MIME function.
Sending an E-Mail message with Multipurpose Internet Mail Extensions (MIME) is a multi step process:
The following MIME types are supported by default. The binary attachment should cover most types such as jpg, gif, etc. The types are defined in \nburn\nbrtos\include\mailto.h
, and the functions are implemented in \nburn\system\mailto.cpp
.
MIME Content Types defined by MIME Content Types.
smtp_server | IP address of the destination SMTP server. |
userid | ASCII string representing the RFC 931 identification. |
pass | Password. |
from_addr | Reverse path per RFC 821, reverse source route. |
to_addr | Destination email address. |
subject | Email subject. |
fd | A �reference� (or pointer) to an integer value of the calling function. The value of fd is modified by this function and will contain the file descriptor for the open SMTP Session. This value must always be checked to be greater than 0 for a valid Session. The fd is passed to other MIME functions to identify the open Session. |
int SendMailEx | ( | IPADDR | smtp_server, |
PCSTR | userid, | ||
PCSTR | from_addr_rev_path, | ||
PCSTR | from_addr_memo_hdr, | ||
PCSTR | to_addr, | ||
PCSTR | subject, | ||
PCSTR | textbody ) |
#include <mailto.h>
Send an email message function, extended version.
Send an email message with extended parameters. The function will open a TCP connection to the specified SMTP server, create a message based on the parameters, and send the message. This function is identical to SendMail( ), with the addition of the from_addr_rev_path and from_addr_memo_hdr parameters.
smtp_server | IP address of the destination SMTP server. |
userid | ASCII string representing the RFC 931 identification. |
from_addr_rev_path | Reverse path per RFC 821, reverse source route. |
from_addr_memo_hdr | From address memo header per RFC 821. Contains items such as date, subject, to:, CC: and from:. |
to_addr | Destination email address |
subject | Email subject |
textbody | Body of email message |