Skip to content

Classes Documentation Pure C Interface

Jeremy Dumais edited this page Jan 3, 2024 · 3 revisions

Classes documentation (Pure C Interface)

Class diagram

Class diagram

Available classes

All classes are located in the jed_utils namespace

OpportunisticSecureSMTPClient class

OpenSSL is required

Available methods

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);

OpportunisticSecureSMTPClient sendMail method Return Codes

See the files socketerrors.h, sslerrors.h and smtpclienterrors.h

ForcedSecureSMTPClient class

OpenSSL is required

Available methods

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);

ForcedSecureSMTPClient sendMail method Return Codes

See the files socketerrors.h, sslerrors.h and smtpclienterrors.h

SmtpClient class

Available methods

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);

SmtpClient sendMail method Return Codes

See the files socketerrors.h and smtpclienterrors.h

MessageAddress class

Available methods

explicit MessageAddress(const char *pEmailAddress, const char *pDisplayName = "");
explicit operator std::string() const;
const char *getEmailAddress() const;
const char *getDisplayName() const;

Attachment class

Available methods

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 class

Available methods

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 class

Available methods

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 class

Available methods

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);