diff options
| author | grunfink <grunfink@noreply.codeberg.org> | 2025-04-27 03:11:57 +0000 |
|---|---|---|
| committer | grunfink <grunfink@noreply.codeberg.org> | 2025-04-27 03:11:57 +0000 |
| commit | 169c5c8c070c527e7462e6ac86b916e94649c1ac (patch) | |
| tree | f1ce03b950a278a1985526cb58dc4e879c3ab046 /tests | |
| parent | 2e39e4e3c36dc23598173f3b6fe64a103574d089 (diff) | |
| parent | 7f936d2d1a88840209895c6091801e8c4cfdaaa1 (diff) | |
Merge pull request 'do email notifications with CURL' (#283) from shtrophic/snac2:curl-smtp into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/283
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/smtp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/smtp.c b/tests/smtp.c new file mode 100644 index 0000000..1100a9d --- /dev/null +++ b/tests/smtp.c @@ -0,0 +1,24 @@ +/* snac - A simple, minimalistic ActivityPub instance */ +/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ + +#define XS_IMPLEMENTATION +#include "../xs.h" +#include "../xs_curl.h" + +#define FROM "<snac-smtp-test@locahost>" + +int main(void) { + xs *to = xs_fmt("<%s@localhost>", getenv("USER")), + *body = xs_fmt("" + "To: %s \r\n" + "From: " FROM "\r\n" + "Subject: snac smtp test\r\n" + "\r\n" + "If you read this as an email, it probably worked!\r\n", + to); + + return xs_smtp_request("smtp://localhost", NULL, NULL, + FROM, + to, + body, 0); +}
\ No newline at end of file |