G
Guest
Hello Everyone,
I really need help in this email. I am using pop3 service to connect to
microsoft exchange. I have two profiles defined
in microsoft exchange.
One is west1 and another one is west2.
When I am trying to connect to west1.
I can succesfully connect to the excahnge mail box, but if i try to connect
to another west2 profile then
I get an error that server does not exists. Although in microsoft exchange
itself, I can successfully connect to both the profiles.
I am having problem in the code.
Below is the code for connecting to the server, but I don't know where
should I define the profile.
private void serverConnection(string userName, string password, string
serverName, DataRow dr1, DataRow dr)
{
long msgNumber;
string strMessage;
Pop3 obj = new Pop3();
obj.Connect(serverName, userName, password);
}
public void Connect(string server, string username,
string password)
{
string message;
string response;
Connect(server, 110);
response = Response();
if (response.Substring(0, 3) != "+OK")
{
throw new Pop3Exception(response);
}
message = "USER " + username + "\r\n";
Write(message);
response = Response();
if (response.Substring(0, 3) != "+OK")
{
throw new Pop3Exception(response);
}
message = "PASS " + password + "\r\n";
Write(message);
response = Response();
if (response.Substring(0, 3) != "+OK")
{
throw new Pop3Exception(response);
}
}
In the show profile box of microsoft outlook, I have defined under "When
starting microsoft outlook use this profile" west2.
Can anyone please tell me where can I define the profile and succesfully
connect to the excahnge server or if there is any other way to connect to
different profiles.
Any help will be greatly appreciated.
I really need help in this email. I am using pop3 service to connect to
microsoft exchange. I have two profiles defined
in microsoft exchange.
One is west1 and another one is west2.
When I am trying to connect to west1.
I can succesfully connect to the excahnge mail box, but if i try to connect
to another west2 profile then
I get an error that server does not exists. Although in microsoft exchange
itself, I can successfully connect to both the profiles.
I am having problem in the code.
Below is the code for connecting to the server, but I don't know where
should I define the profile.
private void serverConnection(string userName, string password, string
serverName, DataRow dr1, DataRow dr)
{
long msgNumber;
string strMessage;
Pop3 obj = new Pop3();
obj.Connect(serverName, userName, password);
}
public void Connect(string server, string username,
string password)
{
string message;
string response;
Connect(server, 110);
response = Response();
if (response.Substring(0, 3) != "+OK")
{
throw new Pop3Exception(response);
}
message = "USER " + username + "\r\n";
Write(message);
response = Response();
if (response.Substring(0, 3) != "+OK")
{
throw new Pop3Exception(response);
}
message = "PASS " + password + "\r\n";
Write(message);
response = Response();
if (response.Substring(0, 3) != "+OK")
{
throw new Pop3Exception(response);
}
}
In the show profile box of microsoft outlook, I have defined under "When
starting microsoft outlook use this profile" west2.
Can anyone please tell me where can I define the profile and succesfully
connect to the excahnge server or if there is any other way to connect to
different profiles.
Any help will be greatly appreciated.