On Fri, Feb 27, 2015 at 9:01 AM, aRkadeFR <
con...@arkade.info> wrote:
> Hello,
>
> I've written couple of time similar command for my project too.
>
> But if I take a step back, these commands (for my projects) are
> only here to test that my SMTP settings are well setup. Thus,
> the test sending email is quite unnecessary, I would like a check
> that connects to the SMTP server (if the emails settings are
> setup else do nothing) when the application starts.
> (I don't know if there's something like saying to a SMTP server:
> am I allowed here? without sending an actual email)
>
> Have a good day
In Simple Mail Transfer Protocol terms, it definitely is (EHLO, MAIL
FROM, RCPT TO, then disconnect without sending DATA). But SMTP is not
the only mail backend, and smptlib does not expose that level of
connection detail - it will merely raise a different exception type if
any of those commands do not return 250 status.
Hey, that time spent reading RFC 821 at uni just paid off ;)
Cheers
Tom