SharkSSL™ Embedded SSL/TLS Stack
|
This class is a minimal SMTP client that takes an email message body and passes it on to a SMTP server.
Email messages can be used to provide status reports or alarm notifications for embedded devices.
This ANSI C library, is designed as one class with C++ wrapper functions in the header file. Please refer to the following article for more information on Object Oriented programming in C code .
C++ Example code:
#include <SMTP.h>
Public Member Functions | |
SMTP (const char *from, const char *to, const char *subject, const char *smtpServer, int port=25, SharkSsl *sharkSsl=0, bool startTLS=false, const char *username=0, const char *password=0, const char *clientDomainName=0, const char *serverDomainName=0, SeCtx *ctx=0) | |
Initiate the SMTP email message. More... | |
~SMTP () | |
The destructor automatically commits the email if you do not call SMTP::commit. More... | |
int | addRecipient (const char *to) |
Optionally add more recipients to this email. More... | |
void | setContentType (const char *type) |
Set content-type. More... | |
int | write (const char *txt, int len=-1) |
Add body text to email. More... | |
int | printf (const char *fmt,...) |
Add body text to email. More... | |
int | commit () |
Commit (send) email. More... | |
SMTP_ErrCode | getEcode () const |
Get the error code (SMTP_ErrCode), if any. More... | |
const char * | getEmsg () |
Returns the SMTP error message if any. | |
bool | bit8 () |
Returns true if server supports 8BITMIME. More... | |
bool SMTP::bit8 | ( | ) |
Returns true if server supports 8BITMIME.
You must make sure you do not send messages not in the seven-bit ASCII character set if this function returns false.
SMTP_ErrCode SMTP::getEcode | ( | ) | const |
Get the error code (SMTP_ErrCode), if any.