Reputation: 439
Hello I am currently using limilabs library to connect to my gmail account. The purpose of the program is to send mail and to receive. On my laptop I can only receive mails but on my friend's pc he can both receive and send. So my question is why can't I receive emails on my laptop?
The program is supposed to download the emails and populate the subject in a listbox and on my friend's laptop it is working but not on mine. I am getting some error with port 143. Here is part of my code. Thank you in advance.
public void ReadMail()
{
using (Imap imap = new Imap())
{
try
{
imap.Connect("imap.gmail.com"); //ConnectSSL for SSL
imap.Login("xxxxxxxxx", "xxxxxx");
}
catch (Exception ex)
{
MessageBox.Show("Log in failed. " + ex.ToString(), "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Upvotes: 0
Views: 4075
Reputation: 439
I found the solution:
I needed to use ConnectSSL method, and change the port to 993
Here is the single line of code that needed to be changed:
imap.ConnectSSL("imap.gmail.com",993);
Upvotes: 1
Reputation: 30651
Disclaimer - I know nothing about Limilabs mail library.
Two things come to mind:
(From the GMail help)
Enable IMAP in your Gmail settings
- Sign in to Gmail.
- Click the gear icon in the upper right, then select Settings.
- Click Forwarding and POP/IMAP.
- Select Enable IMAP.
- Click Save Changes.
With regards to actually connecting to IMap, the same help page gives the following settings to use:
- imap.gmail.com
- Port: 993
- Requires SSL:Yes
- Full Name or Display Name: [your name]
- Account Name or User Name: your full Gmail address ([email protected]). Google Apps users, please enter username@your_domain.com
- Email address: your full Gmail address ([email protected]) Google Apps users, please enter username@your_domain.com
- Password: your Gmail password
Upvotes: 0