Skip to main content

Crate use_smtp

Crate use_smtp 

Source
Expand description

§use-smtp

SMTP protocol vocabulary primitives for RustUse.

§Experimental

use-smtp is experimental while use-email remains below 0.3.0.

§Example

use use_smtp::{MailFrom, RcptTo, SmtpCommand, SmtpReply, SmtpReplyCode};

let mail_from = SmtpCommand::MailFrom(MailFrom::new("bounce@example.com")?);
let rcpt_to = SmtpCommand::RcptTo(RcptTo::new("jane@example.com")?);
let reply = SmtpReply::new(SmtpReplyCode::new(250)?, "OK")?;

assert_eq!(mail_from.to_string(), "MAIL FROM:<bounce@example.com>");
assert_eq!(rcpt_to.to_string(), "RCPT TO:<jane@example.com>");
assert_eq!(reply.to_string(), "250 OK");

§Scope

  • SMTP command, reply, reply code, enhanced status code, extension, EHLO keyword, MAIL FROM, RCPT TO, DATA, QUIT, and capability markers.
  • Protocol vocabulary only.

§Non-goals

  • Network client behavior.
  • TLS negotiation.
  • Authentication, delivery, retry, queue, or provider integration.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

DataCommand
DATA command marker.
EhloKeyword
EHLO keyword metadata.
EightBitMimeCapability
8BITMIME capability marker.
MailFrom
MAIL FROM command.
QuitCommand
QUIT command marker.
RcptTo
RCPT TO command.
SmtpEnhancedStatusCode
SMTP enhanced status code.
SmtpReply
SMTP reply line metadata.
SmtpReplyCode
SMTP reply code.
SmtpUtf8Capability
SMTPUTF8 capability marker.
StartTlsCapability
STARTTLS capability marker.

Enums§

SmtpCommand
SMTP command vocabulary.
SmtpError
Error returned by SMTP vocabulary constructors.
SmtpExtension
SMTP extension labels.