NetBurner 3.5.0
PDF Version
 
mailto.h File Reference

Send Emails with SMTP. More...

#include <predef.h>
#include <nettypes.h>

Go to the source code of this file.

Macros

#define STATUS_OK   (0)
 OK, no errors.
 
#define CONNECT_TO_SMTP_SERVER_FAILED   (-1)
 Could not connect to SMTP server.
 
#define INITIAL_SERVER_REPLY_FAILED   (-2)
 Initial server reply failed.
 
#define HELO_SERVER_REPLY_FAILED   (-3)
 Server HELO reply failed.
 
#define MAIL_FROM_SERVER_REPLY_FAILED   (-4)
 Mail From server reply failed.
 
#define RCPT_TO_SERVER_REPLY_FAILED   (-5)
 Receipt To server reply failed.
 
#define DATA_SERVER_REPLY_FAILED   (-6)
 Data server reply failed.
 
#define DATA_END_SERVER_REPLY_FAILED   (-7)
 Date end server reply failed.
 
#define AUTH_LOGIN_SERVER_REPLY_FAILED   (-8)
 AUTH login server reply failed.
 
#define USER_ID_SERVER_REPLY_FAILED   (-9)
 User ID server reply failed.
 
#define PASSWORD_SERVER_REPLY_FAILED   (-10)
 Password server reply failed.
 
#define CONNECT931_SMTP_SERVER_FAILED   (-11)
 SMTP connection failed.
 

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...
 

Detailed Description

Send Emails with SMTP.