# How get MailSeverConnect to resolve host?

I've tried without success to get MailServerConnect to work, in the first instance, with Gmail.

Method 1: In Mathematica's Preferences > Internet and Mail > Incoming, i specified mail.gmail.com as Server, my username on Gmail as Username, entered my paswword there, and saved. Yet

MailServerConnect[]


gives error "Could not resolve host: mail.gmail.com".

Method 3: Evaluating

MailServerConnect[MailSettings ->
<|"IncomingMailServer" -> <|"Host" -> "mail.gmail.com",


followed by entering my Gmail password at the pop-up prompt, gives the same error.

What's wrong?

• For Gmail the host is imap.gmail.com. – Rohit Namjoshi Jan 10 at 21:06
• @RohitNamjoshi: Are you sure about that? Because if I use it, I get a different error message now from MailServerConnect: Login denied. (When specifying my Mail Settings in Mathematica's Preferences, do I include the @gmail.com as part of my username? (I've tried it both with and without, and still same error from MailServerConnect.) – murray Jan 11 at 16:13
• Hi @murray, I ran into the same issue, and the only workaround I could find was to change the security settings on my GMail account. The reason / instructions are described here. It would be nice if WL used the 'stronger security measures' referred to in that link. For username, I include the @gmail.com part. – Rohit Namjoshi Jan 12 at 0:09
• @RohitNamjoshi: Thanks for that tip! – murray Jan 12 at 1:41