In SMTP, what is supposed to come after the HELO command and what does it do?
I’m sending email in my application and I’m wondering if I should use localhost, the domain name of the from-address (me@example.com), the domain name of the application server (where the email is being sent from) or something else.
The parameter after HELO should identify the system sending the email. So, you would use an externally addressable DNS name for your sending machine.
Do not use
localhostbecause a lot of spam software does that, and your email will be marked as spam.From RFC 2821:
I would usually recommend that you use a real MTA, and hand off your email to the MTA for ultimate delivery. That way you don’t have to reinvent the implementation of the SMTP protocol, which is surprisingly easy to get wrong.