-
Notifications
You must be signed in to change notification settings - Fork 4
npp_email_attach
Jurek Muszyński edited this page Dec 19, 2021
·
2 revisions
bool npp_email_attach(const char *to, const char *subject, const char *message, const char *att_name, const char *att_data, int att_data_len)
Sends an email using sendmail via pipe. att_name, att_data and att_data_len need to specify the attachement.
Sender is composed in the following way:
sprintf(sender, "%s <%s@%s>", NPP_APP_WEBSITE, NPP_EMAIL_FROM_USER, NPP_APP_DOMAIN);
Default NPP_EMAIL_FROM_USER
is noreply
and can be redefined by NPP_EMAIL_FROM_USER.
TRUE on success, otherwise FALSE.
char msg[1024];
STRM_BEGIN(msg);
STRM("Dear %s,\n\n", npp_usr_name(NULL, NULL, NULL, UID));
STRM("Thank you for your custom. Please find attached invoice.\n\n");
STRM("King Regards,\n");
STRM(NPP_APP_WEBSITE);
STRM_END;
npp_email_attach(SESSION.email, "Invoice", msg, "invoice.pdf", SESSION_DATA.invoice_data, SESSION_DATA.invoice_len);