1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # wasm-smtp
//!
//! Environment-independent SMTP client core for WASM and other constrained
//! runtimes.
//!
//! This crate implements the SMTP state machine, response parsing, command
//! formatting, dot-stuffing, and error classification. It is intentionally
//! free of any runtime-specific socket code: applications must provide a
//! [`Transport`] implementation that wraps the runtime-native socket type.
//! Adapter crates such as `wasm-smtp-cloudflare` provide ready-made
//! transports.
//!
//! ## Scope
//!
//! - **TLS is required.** Implicit TLS (port 465) is the standard connection
//! model. STARTTLS (port 587) is also supported via
//! [`SmtpClient::connect_starttls`] and the [`StartTlsCapable`] trait; see
//! those pages for usage. In both cases the TLS handshake itself is the
//! [`Transport`] implementation's responsibility — the core operates on an
//! already-secure byte stream.
//! - **MIME composition is out of scope.** Callers pass a fully-formed,
//! CRLF-normalized message body string to [`SmtpClient::send_mail`].
//! - **Bulk delivery, retry queues, and rate limiting are out of scope.** They
//! belong in the calling application.
//!
//! ## Example
//!
//! ```ignore
//! use wasm_smtp::{SmtpClient, Transport};
//!
//! async fn send<T: Transport>(transport: T) -> Result<(), wasm_smtp::SmtpError> {
//! let mut client = SmtpClient::connect(transport, "client.example.com").await?;
//! // login() picks the best mechanism the server advertised:
//! // PLAIN if available, falling back to LOGIN. For explicit
//! // control, use login_with(AuthMechanism::Plain, …).
//! client.login("user@example.com", "secret").await?;
//! client.send_mail(
//! "user@example.com",
//! &["recipient@example.org"],
//! "From: user@example.com\r\n\
//! To: recipient@example.org\r\n\
//! Subject: Hello\r\n\
//! \r\n\
//! Body text.\r\n",
//! ).await?;
//! client.quit().await?;
//! Ok(())
//! }
//! ```
//!
//! ## Acceptable use
//!
//! See `TERMS_OF_USE.md` at the repository root. This crate must not be used
//! to deliver unsolicited bulk mail, to impersonate other senders, or to
//! deliver mail that violates the operating policy of any SMTP server.
pub use ;
pub use ;
pub use MessageBody;
pub use SendOutcome;
pub use ;
pub use SessionState;
pub use ;