smtp-zig

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 17790173f953d34fd0e2c9cd7c8e0c9bf9be4e5f
parent c99cb339e87b28d937899f9561f106968772ee0c
Author: Martin Ashby <martin@ashbysoft.com>
Date:   Sun, 26 May 2024 14:48:20 +0100

Changes for latest zig master

Diffstat:
Mbuild.zig | 6+++---
Msrc/main.zig | 4++--
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/build.zig b/build.zig @@ -6,15 +6,15 @@ pub fn build(b: *std.Build) void { const lib = b.addStaticLibrary(.{ .name = "smtp", - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); b.installArtifact(lib); - _ = b.addModule("smtp", .{ .root_source_file = .{ .path = "src/main.zig" } }); + _ = b.addModule("smtp", .{ .root_source_file = b.path("src/main.zig") }); const main_tests = b.addTest(.{ - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); diff --git a/src/main.zig b/src/main.zig @@ -341,8 +341,8 @@ test "send email" { \\ \\This is a test message ; - const user = std.os.getenv("SMTP_USERNAME").?; - const pass = std.os.getenv("SMTP_PASSWORD").?; + const user = std.posix.getenv("SMTP_USERNAME").?; + const pass = std.posix.getenv("SMTP_PASSWORD").?; var client = try Client.init(std.testing.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);