TReK ANSI-C
5.3.3
All ANSI-C APIs
|
An ANSI C email device API. More...
Functions | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | InitToolkitEmail (const char *config_pathname, const char *email_account_password) |
Intializes the email and texting library using parameters read from a configuration file. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | InitializeToolkitEmail (const char *smtp_server_address, const char *email_account_username, const char *email_account_password, const char *email_address, const char *email_name, boolean_type verify_cert_authorities, boolean_type generate_curl_debug_messages) |
Intializes the email and texting library using input parameters. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | SetCertAuthoritesPathAndFilename (const char *ca_path_and_filename) |
Sets an alternate path and file name for the Certificate Authorities (CA) file referenced by curl if curl has been configured to verify CAs. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | AddToEmailAddress (const char *to_email_address, const char *to_email_name, const char *to_group_name) |
Adds "to" address information to a list of email addresses and associates the email address with a group name if a group name is included with the function call. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | AddCcEmailAddress (const char *cc_email_address, const char *cc_email_name, const char *cc_group_name) |
Adds "cc" address information to a list of email addresses and associates the email address with a group name if a group name is included with the function call. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | AddTextToCellPhoneNumber (const char *text_to_cell_phone_number, const char *text_to_cell_phone_carrier, const char *text_to_group_name) |
Adds "text to" cell phone numbers to a list of cell phone numbers and associates the cell phone numbers with a group name if a group name is included with the function call. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | RemoveToEmailAddress (const char *to_email_address, const char *group_name) |
Removes "to" address information from a list of email addresses associated with the email address or group name. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | RemoveCcEmailAddress (const char *cc_email_address, const char *group_name) |
Removes "cc" address information from a list of email addresses associated with the email address or group name. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | RemoveTextToCellPhoneNumber (const char *text_to_cell_phone_number, const char *group_name) |
Removes "text to" cell phone numbers from a list of cell phone numbers and associated with the cell phone numbers or group name. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | CreateAnEmailMessageDropbox (const char *dropbox_path, const char *email_address_or_group_name, const char *successful_trans_path) |
Creates an email message dropbox. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | CreateAnEmailFileDropbox (const char *dropbox_path, const char *email_address_or_group_name, const char *successful_trans_path) |
Creates an email file dropbox. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | CreateATextingDropbox (const char *dropbox_path, const char *cell_phone_number_or_group_name, const char *successful_trans_path) |
Creates a texting dropbox. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | StartLoggingTReKMessages (const char *log_file_path, const char *log_filename, boolean_type log_debug_messages) |
Starts logging messages to a file. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | StopLoggingTReKMessages () |
Stops logging messages to a file, closes the log file and renames the log file by concatenating the log file name with a GMT time string. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | SendEmail (const char *subject, const char *message, const char *email_address_or_group_name) |
Sends an email to the designated email address or group name of recipients. The maximum length of an email is 65000 characters or bytes. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | SendEmailWithFile (const char *subject, const char *message, const char *email_address_or_group_name, const char *file_path, const char *file_name) |
Sends an email message and a file as an email attachment to the designated email address or group name of recipients. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | SendText (const char *text, const char *cell_phone_number_or_group_name) |
Sends a text to the designated cell_phone_number or group of recipients. The maximum length of a text is 65000 characters or bytes. More... | |
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION | SaveToolkitEmailConfig (const char *config_pathname) |
Saves the email and texting configuration parameters in a text file. More... | |
An ANSI C email device API.
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION AddCcEmailAddress | ( | const char * | cc_email_address, |
const char * | cc_email_name, | ||
const char * | cc_group_name | ||
) |
Adds "cc" address information to a list of email addresses and associates the email address with a group name if a group name is included with the function call.
[in] | cc_email_address | The cc email address. |
[in] | cc_email_name | The cc name. |
[in] | cc_group_name | The group name associated with the address. If no group name has been identified, simply pass an empty string (i.e., "") |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION AddTextToCellPhoneNumber | ( | const char * | text_to_cell_phone_number, |
const char * | text_to_cell_phone_carrier, | ||
const char * | text_to_group_name | ||
) |
Adds "text to" cell phone numbers to a list of cell phone numbers and associates the cell phone numbers with a group name if a group name is included with the function call.
[in] | text_to_cell_phone_number | The text to cell phone number. |
[in] | text_to_cell_phone_carrier | The text to cell phone carrier or carrier gateway domain (e.g., T-MOBILE or tmomail.net, AT&T or mms.att.net, VERIZON...) |
[in] | text_to_group_name | The group name associated with the text to cell phone number. If no group name has been identified, simply pass an empty string (i.e., "") |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION AddToEmailAddress | ( | const char * | to_email_address, |
const char * | to_email_name, | ||
const char * | to_group_name | ||
) |
Adds "to" address information to a list of email addresses and associates the email address with a group name if a group name is included with the function call.
[in] | to_email_address | The email address that receives the email. |
[in] | to_email_name | The email name that receives the email. |
[in] | to_group_name | The group name associated with the address. If no group name has been identified, simply pass an empty string (i.e., "") |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION CreateAnEmailFileDropbox | ( | const char * | dropbox_path, |
const char * | email_address_or_group_name, | ||
const char * | successful_trans_path | ||
) |
Creates an email file dropbox.
The file, placed in an email file dropbox, is sent as a file attachment of an email to desgnated recipients.. The file name becomes the subject of the email.
[in] | dropbox_path | The full path and the dropbox directory. |
[in] | email_address_or_group_name | The email address or group name associated with a list of recipients. |
[in] | successful_trans_path | The full path and the successful transaction directory. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION CreateAnEmailMessageDropbox | ( | const char * | dropbox_path, |
const char * | email_address_or_group_name, | ||
const char * | successful_trans_path | ||
) |
Creates an email message dropbox.
The content of a file, placed in an email message dropbox, is sent as the message of an email to desgnated recipients. The file name becomes the subject of the email.
[in] | dropbox_path | The full path and the dropbox directory. |
[in] | email_address_or_group_name | The email address or group name associated with a list of recipients. |
[in] | successful_trans_path | The full path and the successful transaction directory. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION CreateATextingDropbox | ( | const char * | dropbox_path, |
const char * | cell_phone_number_or_group_name, | ||
const char * | successful_trans_path | ||
) |
Creates a texting dropbox.
The content of a file, placed in a texting dropbox, is sent as a text to desgnated recipients.
[in] | dropbox_path | The full path and the dropbox directory. |
[in] | cell_phone_number_or_group_name | The cell phone number or group name associated with a list of recipients. |
[in] | successful_trans_path | The full path and the successful transaction directory. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION InitializeToolkitEmail | ( | const char * | smtp_server_address, |
const char * | email_account_username, | ||
const char * | email_account_password, | ||
const char * | email_address, | ||
const char * | email_name, | ||
boolean_type | verify_cert_authorities, | ||
boolean_type | generate_curl_debug_messages | ||
) |
Intializes the email and texting library using input parameters.
[in] | smtp_server_address | Email SMTP server address (e.g., smtp.gmail.com). |
[in] | email_account_username | Email account username. |
[in] | email_account_password | Email account password. |
[in] | email_address | Email address. |
[in] | email_name | Email name. |
[in] | verify_cert_authorities | Set this boolean_type variable to TRUE_OR_YES to verify certificate of authority. |
[in] | generate_curl_debug_messages | Set this boolean_type variable to TRUE_OR_YES to generate curl debug messages associated with transferring data with the email server. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION InitToolkitEmail | ( | const char * | config_pathname, |
const char * | email_account_password | ||
) |
Intializes the email and texting library using parameters read from a configuration file.
[in] | config_pathname | The full path and filename of the Email Device configuration file. |
[in] | email_account_password | The password to the email account. If the password is provided by the configuration file, simply pass an empty string (i.e., ""). |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION RemoveCcEmailAddress | ( | const char * | cc_email_address, |
const char * | group_name | ||
) |
Removes "cc" address information from a list of email addresses associated with the email address or group name.
[in] | cc_email_address | The "cc" email address. |
[in] | group_name | The group name. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION RemoveTextToCellPhoneNumber | ( | const char * | text_to_cell_phone_number, |
const char * | group_name | ||
) |
Removes "text to" cell phone numbers from a list of cell phone numbers and associated with the cell phone numbers or group name.
[in] | text_to_cell_phone_number | The "text to" cell phone number. |
[in] | group_name | The group name. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION RemoveToEmailAddress | ( | const char * | to_email_address, |
const char * | group_name | ||
) |
Removes "to" address information from a list of email addresses associated with the email address or group name.
[in] | to_email_address | The "to" email address. |
[in] | group_name | The group name. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION SaveToolkitEmailConfig | ( | const char * | config_pathname | ) |
Saves the email and texting configuration parameters in a text file.
Note: The email account password is not saved in the configuration file. A user must add the password to the "email_account_password" tag in the configuration file if they want to store the password in the configuration file.
[in] | config_pathname | The full path and filename of the CFDP configuration file. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION SendEmail | ( | const char * | subject, |
const char * | message, | ||
const char * | email_address_or_group_name | ||
) |
Sends an email to the designated email address or group name of recipients. The maximum length of an email is 65000 characters or bytes.
[in] | subject | The subject or title of the email. |
[in] | message | The body of the email. |
[in] | email_address_or_group_name | The email address or group name associated with a list of recipients. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION SendEmailWithFile | ( | const char * | subject, |
const char * | message, | ||
const char * | email_address_or_group_name, | ||
const char * | file_path, | ||
const char * | filename | ||
) |
Sends an email message and a file as an email attachment to the designated email address or group name of recipients.
[in] | subject | The subject or title of the email. |
[in] | message | The body of the email. |
[in] | email_address_or_group_name | The email address or group name associated with a list of recipients. |
[in] | file_path | The full path and the file directory. |
[in] | filename | The file name. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION SendText | ( | const char * | text, |
const char * | cell_phone_number_or_group_name | ||
) |
Sends a text to the designated cell_phone_number or group of recipients. The maximum length of a text is 65000 characters or bytes.
[in] | text | The body of the email. |
[in] | cell_phone_number_or_group_name | The cell phone number or group name associated with a list of recipients. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION SetCertAuthoritesPathAndFilename | ( | const char * | ca_path_and_filename | ) |
Sets an alternate path and file name for the Certificate Authorities (CA) file referenced by curl if curl has been configured to verify CAs.
Curl's default CA file name is "curl-ca-bundle.crt" and default location is the "cert" folder found in the TReK install directory.
[in] | ca_path_and_filename | Curl's CA path and file name. |
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION StartLoggingTReKMessages | ( | const char * | log_file_path, |
const char * | log_filename, | ||
boolean_type | log_debug_messages | ||
) |
Starts logging messages to a file.
[in] | log_file_path | The path of the log file. If an empty string is provided, the default path is the user's home directory. | ||||||
[in] | log_filename | The base file name of the log file. When logging is stopped, this name will be concatenated with a GMT time string. | ||||||
[in] | log_debug_messages | Set this boolean_type variable to TRUE_OR_YES to log debug messages. The boolean_type is defined in the file "ds_shared.h" as follows:
|
Example:
int EXPORT_THIS_TOOLKIT_EMAIL_DEVICE_C_FUNCTION StopLoggingTReKMessages | ( | ) |
Stops logging messages to a file, closes the log file and renames the log file by concatenating the log file name with a GMT time string.
Example: