aboutsummaryrefslogtreecommitdiff
path: root/src/smtp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/smtp.h')
-rw-r--r--src/smtp.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/smtp.h b/src/smtp.h
new file mode 100644
index 0000000..a6c4a34
--- /dev/null
+++ b/src/smtp.h
@@ -0,0 +1,24 @@
+#ifndef BOKF_SMTP_H
+#define BOKF_SMTP_H
+
+#include <stddef.h>
+
+struct smtp_message {
+ const char *host;
+ int port;
+ const char *security; /* "tls" (implicit), "starttls", "plain" */
+ const char *user; /* NULL/empty = no AUTH */
+ const char *password;
+ const char *from; /* envelope + From address */
+ const char *from_name; /* display name, may be NULL */
+ const char *to;
+ const char *subject;
+ const char *body; /* UTF-8 text body */
+ const char *attach_name; /* NULL -> text-only */
+ const unsigned char *attach;
+ size_t attach_len;
+};
+
+int smtp_send(const struct smtp_message *m, char *err, size_t errlen);
+
+#endif