Skip to main content

Module builder

Module builder 

Source
Expand description

SMTP packet builder.

Provides a fluent API for constructing SMTP commands and replies.

§Examples

use stackforge_core::layer::smtp::builder::SmtpBuilder;

// Build an EHLO command
let pkt = SmtpBuilder::new().ehlo("client.example.com").build();
assert_eq!(pkt, b"EHLO client.example.com\r\n");

// Build a 250 OK reply
let pkt = SmtpBuilder::new().ok("OK").build();
assert_eq!(pkt, b"250 OK\r\n");

Structs§

SmtpBuilder
Builder for SMTP messages (commands and replies).