aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOliver <zen@noreply.codeberg.org>2025-05-21 21:11:47 +0200
committerOliver <zen@noreply.codeberg.org>2025-05-21 21:11:47 +0200
commit979718e3cc5489efdce2acc6f8c86f6d00bb91c7 (patch)
tree7b4936bdb5ea07c7dd617d508c487d70020f0146 /tests
parent1b0804bb0da0ef89aef98d9a771d2aa5bfeb34d7 (diff)
parent5059fadf34b79a9f596313b0bd859c1eb89342ae (diff)
Merge pull request 'master refresh' (#8) from grunfink/snac2:master into master
Reviewed-on: https://codeberg.org/zen/snac2/pulls/8
Diffstat (limited to 'tests')
-rw-r--r--tests/smtp.c24
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