···2020 .port = 25,
2121 .encryption = .none,
2222 .host = "localhost",
2323+ .allocator = allocator,
2324 // .username="username",
2425 // .password="password",
2526 };
26272727- try smtp.send(allocator, .{
2828+ try smtp.send(.{
2829 .from = "admin@localhost",
2930 .to = &.{"user@localhost"},
3031 .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",
···7374 .data = "...",
7475 }
7576 };
7676- try smtp.sendAll(allocator, &messages, config, &sent);
7777+ try smtp.sendAll(&messages, config, &sent);
7778```
78797980`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).