diff options
author | Martin Ashby <martin@ashbysoft.com> | 2023-08-24 17:35:37 +0100 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2023-08-24 17:35:37 +0100 |
commit | 6d3d2869bb2105c3a9ffb54ed816d8f53c56c1ed (patch) | |
tree | 6655b794f964a000433916d882de980757bb1913 /README.md | |
download | smtp-zig-6d3d2869bb2105c3a9ffb54ed816d8f53c56c1ed.tar.gz smtp-zig-6d3d2869bb2105c3a9ffb54ed816d8f53c56c1ed.tar.bz2 smtp-zig-6d3d2869bb2105c3a9ffb54ed816d8f53c56c1ed.tar.xz smtp-zig-6d3d2869bb2105c3a9ffb54ed816d8f53c56c1ed.zip |
Initial
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..2b0ab93 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# smtp-zig + +SMTP client library for zig. + +WORK IN PROGRESS. + +TODO: +- [ ] Dot encoding/escaping +- [ ] Lots more tests +- [ ] Support more extensions and authentication mechanisms +- [ ] Zig package management + +Code example: +``` +const std = @import("std"); +const client = @import("smtp"); + +pub fn main() !void { + const mail = + \\Subject: test + \\From: <martin@mfashby.net> + \\To: <martin@mfashby.net> + \\ + \\This is a test message + ; + const user = std.os.getenv("SMTP_USERNAME").?; + const pass = std.os.getenv("SMTP_PASSWORD").?; + var client = try Client.init(std.heap.page_allocator, "mail.mfashby.net:587", .{.user = user, .pass = pass}); + defer client.deinit(); + try client.send_mail("martin@mfashby.net", &[_][]const u8{"martin@mfashby.net"}, mail); + try client.quit(); +} +``` + +This project is licensed under the terms of the MIT license.
\ No newline at end of file |