Hello rockyshah2015,
please change your program to also log the LogLevel.Debug information for both Imap and Smtp client instances like this:
Imap imap = new Imap();
imap.LogWriter = new Rebex.FileLogWriter(@"D:\Rahultemp\logRebex.txt", Rebex.LogLevel.Debug);
...
Smtp objsmtp = new Smtp();
objsmtp.LogWriter = new Rebex.FileLogWriter(@"D:\Rahultemp\logRebex.txt", Rebex.LogLevel.Debug);
I also recommend you to discard this line of code:
imap.Timeout = int.MaxValue;
Please send us the newly created log - you can post it here as an answer to this question, or send it to support@rebex.net
Based on this we will check why it takes your program so long to execute with your servers and let you know then.
Thanks!