Reputation: 31
can anyone here help me to solve the exception error "server not found". i believe all the parameter that i set is correct but i wonder why exception still occur.Tq
this is part of my code:
private void button_extract_Click(object sender, RoutedEventArgs e)
{
HeadersFromAndSubject("[email protected]",995,true, textbox_email_retriever.Text,
passwordBox_Receiver.SecurePassword.ToString(), 10);
}
public static void HeadersFromAndSubject(string hostname, int port, bool useSsl,
string username, string password, int messageNumber)
{
using (Pop3Client client = new Pop3Client())
{
client.Connect(hostname, port, useSsl); //error in this line
client.Authenticate(username, password);
}
}
Upvotes: 1
Views: 3615
Reputation: 3560
Should use the server name as below , I dont think it not an gmail account to have it as mail id format , only for authentication we are suppposed to use the mail id , try with this
pop.gmail.com"
Instead of this
[email protected]
Correct me if 'm wrong
Upvotes: 1