locked
System.net.imap4 not connecting gmail server RRS feed

  • Question

  • User-148788041 posted
    Using system.net.imap4
    r client= new Imap4client();
    client.connect("imap.gmail.com",993,true)
    Error cannot connect
    Thursday, November 22, 2018 9:51 AM

All replies

  • User753101303 posted

    Hi,

    This is the real exception message you have? It's best to start from the actual message. For now my guess would be a firewall issue which should show something such as "the connection failed because the server took too much time to respond or don't respond at all" (meaning basically the network request is sent correctly but you don't get any response at all from the server ie most often being blocked by a firewall).

    Thursday, November 22, 2018 10:49 AM
  • User-148788041 posted
    I am able to login into gmail from ie browser.from code i get this exception established connection failed because connected host has failed to respond.

    Is port no and gmail server are correct in code.
    Thursday, November 22, 2018 12:37 PM
  • User753101303 posted

    Seems correct accordint to https://support.google.com/mail/answer/7126229?hl=en (you enabled IMAP as shown in "Step 1" ?). Else it seems a better worded message than the one I expected when blocked by a firewall.

    I'll try myself a bit later.

    Thursday, November 22, 2018 2:52 PM