async-email / async-smtp

Apache License 2.0
60 stars 13 forks source link

Allow sending custom SMTP commands #17

Closed amaury1093 closed 4 years ago

amaury1093 commented 4 years ago

In my project, I need to send custom SMTP commands to test the deliverability of an email. Here's an example of sending the RCTP command, now using lettre: https://github.com/amaurymartiny/check-if-email-exists/blob/0679acc81e0a0d111e2a4db5d9bd6c64e92b7900/core/src/smtp.rs#L128-L132

As far as I understand, in async-smtp, I can either just send all the commands that are needed to send an email.

I propose to have an additional pub method in impl SmtpTransport:

pub async fn command(&mut self, command) {
   let mut client = Pin::new(&mut self.client);
   client
        .as_mut()
        .command(command))
}

If you're okay with that I'll add a PR