SMTP client for Zig
0

Configure Feed

Select the types of activity you want to include in your feed.

update readme to not include allocator as parameter

Karl Seguin (Aug 21, 2023, 3:37 PM +0800) 1ab06abc 04e26ccc

+3 -2
+3 -2
readme.md
··· 20 20 .port = 25, 21 21 .encryption = .none, 22 22 .host = "localhost", 23 + .allocator = allocator, 23 24 // .username="username", 24 25 // .password="password", 25 26 }; 26 27 27 - try smtp.send(allocator, .{ 28 + try smtp.send(.{ 28 29 .from = "admin@localhost", 29 30 .to = &.{"user@localhost"}, 30 31 .data = "From: Admin <admin@localhost>\r\nTo: User <user@localhost>\r\nSuject: Test\r\n\r\nThis is karl, I'm testing a SMTP client for Zig\r\n.\r\n", ··· 73 74 .data = "...", 74 75 } 75 76 }; 76 - try smtp.sendAll(allocator, &messages, config, &sent); 77 + try smtp.sendAll(&messages, config, &sent); 77 78 ``` 78 79 79 80 `sendAll` can fail part way, resulting in some messages being sent while others are not. `sendAll` stops at the first encountered error. The last parameter to `sendAll` is set to the number of successfully sent messages, thus it's possible for the caller to know which messages were and were not sent (e.g. if `sent == 3`, then messages 1, 2 and 3 were sent, message 4 failed and it, along with all subsequent messages, were not sent). Of course, when we say "successfully sent", we only mean from the point of view of this library. SMTP being asynchronous means that this library can successfully send the message to the configured upstream yet the message never reaches the final recipient(s).