Update SMTP example to use smtp.gmail.com so ping actually works#149700
Update SMTP example to use smtp.gmail.com so ping actually works#149700ab12gu wants to merge 1 commit into
Conversation
sepehr-rs
left a comment
There was a problem hiding this comment.
Hi, thanks for your contribution!
I think domain.org was likely intentional as a placeholder hostname. Using smtp.gmail.com would make the example depend on an external third-party service, while this example seems mainly intended to demonstrate the API usage.
Documentation build overview
|
|
I believe that is correct. We could change it to |
|
@bitdancer yeah example is better, but if you ping it via smtplib, you still get an error. I guess my issue was that I had to reference an old python textbook to know that the subdomain This is pretty much standard for using So even with using So I understand @sepehr-rs 3rd party issue, but sometimes its difficult to know these nuances and would prefer a working ping example :). |
Fair point. I think the confusion comes from the example not making it obvious that Though maintainers would probably be better positioned to weigh in on whether that approach fits the documentation style here. |
There was a problem hiding this comment.
Maybe changing it to smtp.domain.org or smtp.example.com is better for clarity that it should be an SMTP server; although they are still not pingable, but it does not rely on a 3rd party service. What's more, at some countries, smtp.gmail.com is actually still not pingable.
|
'smtp' being in the name has nothing to do with whether or not smtplib will be able to connect to it. What matters if whether or not an smtp server is listening on the smtp port of the IP that the name resolves to, regardless of what the name itself is. Looking at the rest of the doc, there is another more complete example later, and it uses This seems particularly appropriate in that in general one should not do testing like this against a server that someone else controls. Get your software working locally first, then test it against real servers ;) Hmm. It occurs to me, though, that it wouldn't be crazy to have a link to https://aiosmtpd.aio-libs.org as a way to run a test smtp server on localhost. That should serve as a pretty big clue ;) Maybe put it in a footnote and reference it from both examples? Note that the examples were written back when the stdlib included an 'smtpd' module, which may be why they assume you know how to run an smtp server on localhost... |
No description provided.