I've been using MailKit to retrieve some emails using IMAP and forwarding them using SMTP (more info here), but it takes really long for the SMTP to send the email.
I'm using mailkit via NuGet
This is the code I'm using
<!-- language: c# -->
var before = DateTime.Now;
Console.Write("\tForwarding email... ");
smtpClient.Send(forwardMessage, fromMailboxAddress, new[] { toMailboxAddress });
Console.WriteLine(" done! ({0})", DateTime.Now - before);
And the time it takes is usually more than 30s. What is making me suspect there's somethign wrong is that the email is actually forwarded almost instantly: few seconds (or even less) than the code reaches the smtpClient.Send
method, I can see the message appearing in the destination email account (I have Thunderbird opened at the same time), but something makes the code to be still doing something in the Send
code line.
Is there a way to know what the code is doing and why does it take so long?