On Wed, 7 Sept 2022 at 15:37, אורי <
u...@speedy.net> wrote:
>
> Hi David,
>
> Does and should Django connect directly to a remote SMTP server? Isn't it better to use the local mail server which will receive the email and then send it to a remote SMTP server? In my opinion, it's always better to send emails via a local mail server on the same machine. Do you have other experiences?
>
> Thanks,
> Uri Rodberg, Speedy Net.
> אורי
>
u...@speedy.net
Hi Uri
Thank you for the reply.
The mail server I'm connecting to, while not on localhost, is on an
internal network and so, somewhat local. I don't have the experience
that sending mail through such a "remote" server is any worse. I
don't have the experience that it's any better either, I just never
had any issues. It does save me from having to setup a mail server.
Anyway, as I mentioned on my proposal, having a mail server on
localhost is exactly the kind of workaround I suggest.
I understand that implementing a full-featured SMTP client may be
outside the scope of Django's mail module. I also understand that
being able to specify the identifier for the HELO command may be
behind the line of what defines a simple SMTP client. But because
this is an option exposed by Python's smtplib, I thought it would be
accepted. However, it's been 13 years since Django's added mail
support and if no one needed the ability to specify this, maybe it is
not worth the extra complication.
Either way, let me know. I can submit a simple PR that adds this
option or document that Django's SMTP client should be connecting to a
full-featured SMTP server on localhost if more complex connections are
required.
Many thanks
David