0

I'm sending emails using gmail's SMTP API. You can specify the host. I don't yet have a domain name so have set this as the IP of my production server. I presume setting the host makes it less likely your messages will be marked as spam and if they are you can resolve any blocking if your messages are legitimate? Any further sources as to understanding what the host attribute is for would be appreciated.

1
  • Can one of the "closers" of this question please explain why this post has been closed. I think it's clear what my question was, additionally there was a great answer from @NickW below and this itself has helped at least 2 other people.
    – AJP
    Aug 13, 2014 at 10:41

1 Answer 1

3

The host is there because often as not, the MX record for a domain only points to a server configured to receive email for that domain(s). Often the server configured to relay mail for authorized clients is not discoverable as such via DNS. There are some protocols like autoconfiguration which will find those sort of values for you, but it is not a standard, and not everyone has it configured.

Also, nowadays, most mail servers will not relay mail for just anyone, so you will be providing the host, and user/password combo to allow the API to send mail through a properly configured (hopefully) server, which will reduce the likelihood your mail ends up marked as spam, and so forth.

Not the answer you're looking for? Browse other questions tagged .