Is there an accepted syntax for SMTP server? (and how to parse it)

While there is a SMTP URL Scheme, I have never seen anyone use it. In practice, most applications provide four separate fields for host, port, user name and password. But if you really need to put those four components into a single string, the example you provided is probably the best-known format for something like this.


Using an URI for specifying a network resource, such as an SMTP server is probably the cloeset thing to a "accepted" format you'd see, an SMTP URI, would be something like smtp://user:[email protected]:port or perhaps just smtp://example.com . You'd use a generic URI parsing library to extract the various components.

There's also an old RFC draft for SMTP URLs