Quantcast
Channel: Blog | Limilabs
Viewing all articles
Browse latest Browse all 120

Gmail: IMAP, POP3, and SMTP settings

$
0
0

Gmail supports access via IMAP, POP3 and SMTP protocols. Below you can find the configuration settings for all protocols.

All Gmail servers (IMAP, POP3 and SMTP) use implicit SSL – use ConnectSSL method.

IMAP

Server: imap.gmail.com
SSL: true, implicit
Port: 993 (default)
User: pat@gmail.com or pat@your-domain.com

POP3

Server: pop.gmail.com
SSL: true, implicit
Port: 995 (default)
User: pat@gmail.com or pat@your-domain.com

SMTP

Server: smtp.gmail.com
SSL: true, implicit
Port: 465 (default)
User: pat@gmail.com or pat@your-domain.com

Following are the code samples for Mail.dll .NET IMAP, POP3 and SMTP component.

Remember that you must enable IMAP in Gmail or enable POP3 in Gmail first.

// C#

using (Imap client = new Imap())
{
    client.ConnectSSL("imap.gmail.com");
    client.UseBestLogin("pat@gmail.com", "password");
    ...
}

using (Pop3 client = new Pop3())
{
    client.ConnectSSL("pop.gmail.com");
    client.UseBestLogin("pat@gmail.com", "password");
    ...
}

using (Smtp client = new Smtp ())
{
    client.ConnectSSL("smtp.gmail.com");
    client.UseBestLogin("pat@gmail.com", "password");
    ...
}
' VB.NET

Using client As New Imap()
	client.ConnectSSL("imap.gmail.com")
	client.UseBestLogin("pat@gmail.com", "password")
	...
End Using

Using client As New Pop3()
	client.ConnectSSL("pop.gmail.com")		
	client.UseBestLogin("pat@gmail.com", "password")
	...
End Using

Using client As New Smtp()
	client.ConnectSSL("smtp.gmail.com")
	client.UseBestLogin("pat@gmail.com", "password")
	...
End Using

You can find more details about using implicit and explicit SSL or TLS with email protocols:


Viewing all articles
Browse latest Browse all 120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>