-
Notifications
You must be signed in to change notification settings - Fork 21
Classes Documentation Pure C Interface
Jeremy Dumais edited this page Jan 3, 2024
·
3 revisions
All classes are located in the jed_utils namespace
- OpportunisticSecureSMTPClient
- ForcedSecureSMTPClient
- SmtpClient
- MessageAddress
- Attachment
- PlaintextMessage
- HTMLMessage
- Credential
OpenSSL is required
OpportunisticSecureSMTPClient(const char *pServerName, unsigned int pPort);
const char *getServerName() const;
unsigned int getServerPort() const;
bool getBatchMode() const;
unsigned int getCommandTimeout() const;
const char *getCommunicationLog() const;
const Credential *getCredentials() const;
bool getAcceptSelfSignedCert() const;
void setServerName(const char *pServerName);
void setServerPort(unsigned int pPort);
void setBatchMode(bool pEnabled);
void setCommandTimeout(unsigned int pTimeOutInSeconds);
void setCredentials(const Credential &pCredential);
void setAcceptSelfSignedCert(bool pValue);
void setKeepUsingBaseSendCommands(bool pValue);
static char *getErrorMessage(int errorCode);
static int getErrorMessage_r(int errorCode, char *errorMessagePtr, const size_t maxLength);
int sendMail(const Message &pMsg);
See the files socketerrors.h, sslerrors.h and smtpclienterrors.h
OpenSSL is required
ForcedSecureSMTPClient(const char *pServerName, unsigned int pPort);
const char *getServerName() const;
unsigned int getServerPort() const;
bool getBatchMode() const;
unsigned int getCommandTimeout() const;
const char *getCommunicationLog() const;
const Credential *getCredentials() const;
bool getAcceptSelfSignedCert() const;
void setServerName(const char *pServerName);
void setServerPort(unsigned int pPort);
void setBatchMode(bool pEnabled);
void setCommandTimeout(unsigned int pTimeOutInSeconds);
void setCredentials(const Credential &pCredential);
void setAcceptSelfSignedCert(bool pValue);
void setKeepUsingBaseSendCommands(bool pValue);
static char *getErrorMessage(int errorCode);
static int getErrorMessage_r(int errorCode, char *errorMessagePtr, const size_t maxLength);
int sendMail(const Message &pMsg);
See the files socketerrors.h, sslerrors.h and smtpclienterrors.h
SmtpClient(const char *pServerName, unsigned int pPort);
const char *getServerName() const;
unsigned int getServerPort() const;
bool getBatchMode() const;
unsigned int getCommandTimeout() const;
const char *getCommunicationLog() const;
const Credential *getCredentials() const;
void setServerName(const char *pServerName);
void setServerPort(unsigned int pPort);
void setBatchMode(bool pEnabled);
void setCommandTimeout(unsigned int pTimeOutInSeconds);
void setCredentials(const Credential &pCredential);
void setKeepUsingBaseSendCommands(bool pValue);
static char *getErrorMessage(int errorCode);
static int getErrorMessage_r(int errorCode, char *errorMessagePtr, const size_t maxLength);
int sendMail(const Message &pMsg);
See the files socketerrors.h and smtpclienterrors.h
explicit MessageAddress(const char *pEmailAddress, const char *pDisplayName = "");
explicit operator std::string() const;
const char *getEmailAddress() const;
const char *getDisplayName() const;
explicit Attachment(const char *pFilename, const char *pName = "");
void setContentId(const char *pContentId);
const char *getName() const;
const char *getFilename() const;
const char *getContentId() const;
const char *getBase64EncodedFile() const;
const char *getMimeType() const;
PlaintextMessage(const MessageAddress &pFrom,
const MessageAddress &pTo,
const char *pSubject,
const char *pBody,
const MessageAddress *pCc = nullptr,
const MessageAddress *pBcc = nullptr,
const Attachment pAttachments[] = nullptr,
size_t pAttachmentsSize = 0);
PlaintextMessage(const MessageAddress &pFrom,
const MessageAddress pTo[],
size_t pToCount,
const char *pSubject,
const char *pBody,
const MessageAddress pCc[] = nullptr,
size_t pCcCount = 0,
const MessageAddress pBcc[] = nullptr,
size_t pBccCount = 0,
const Attachment pAttachments[] = nullptr,
size_t pAttachmentsSize = 0);
const char *getMimeType() const override;
const MessageAddress &getFrom() const;
MessageAddress **getTo() const;
size_t getToCount() const;
const char *getSubject() const;
const char *getBody() const;
MessageAddress **getCc() const;
size_t getCcCount() const;
MessageAddress **getBcc() const;
size_t getBccCount() const;
Attachment **getAttachments() const;
size_t getAttachmentsCount() const;
HTMLMessage(const MessageAddress &pFrom,
const MessageAddress &pTo,
const char *pSubject,
const char *pBody,
const MessageAddress *pCc = nullptr,
const MessageAddress *pBcc = nullptr,
const Attachment *pAttachments = nullptr,
size_t pAttachmentsSize = 0);
HTMLMessage(const MessageAddress &pFrom,
const MessageAddress pTo[],
size_t pToCount,
const char *pSubject,
const char *pBody,
const MessageAddress pCc[] = nullptr,
size_t pCcCount = 0,
const MessageAddress pBcc[] = nullptr,
size_t pBccCount = 0,
const Attachment pAttachments[] = nullptr,
size_t pAttachmentsSize = 0);
const char *getMimeType() const override;
const MessageAddress &getFrom() const;
MessageAddress **getTo() const;
size_t getToCount() const;
const char *getSubject() const;
const char *getBody() const;
MessageAddress **getCc() const;
size_t getCcCount() const;
MessageAddress **getBcc() const;
size_t getBccCount() const;
Attachment **getAttachments() const;
size_t getAttachmentsCount() const;
Credential(const char *pUsername, const char *pPassword);
const char *getUsername() const;
const char *getPassword() const;
RecommendedAuthenticationMethod getRecommendedAuthOption() const;
void setUsername(const char *pUsername);
void setPassword(const char *pPassword);
void setRecommendedAuthOption(RecommendedAuthenticationMethod authOption);