You can do GET and POST request steaight inside code, for example in Python, Java or Javascript. These languages/runtime environments have the ability to broadcast anywhere over the network and send any data, any authentication as well. Why is a dedicated "server" necessary in the case of doing email? At least I found it necessary in Java, either to use a third party connection (I used gmail smtp) or install a local server as opposed to just package imports (jar files) and I assume it's the same for other languages. Why isn't the Java virtual machine itself capable if it can already make Network connections and is it the same in the python interpreter and Node.js?8
Asked
Active
Viewed 61 times
1 Answers
1
An SMTP (Simple Mail Transfer Protocol) server is an application that’s primary purpose is to send, receive, and/or relay outgoing mail between email senders and receivers.
In a few words, because it needs to be secure, authenticated, verifiable, RELIABLE, etc. and the "internet" isn't just gonna trust email coming from you just because you're nice.
SMTP is a protocol. YOU play the part of the CLIENT so YOU CONNECT to SERVER that RELAYS your message AFTER deciding it's NOT GARBAGE/SPAM.
Although you can, you really don't wanna run your own email server. It's incredibly cheap to outsource or free if you just use a service like Gmail since their SMTP server address is made public for all to use.

suchislife
- 4,251
- 10
- 47
- 78