We have been getting SMTP timeouts recently in our "Send Email" steps for some reason. I know you probably can't help us with the root cause of those timeouts, but I have a couple questions about how to deal with them cleanly.
Here is the exception we get:
Initialization complete. Executing...
Preparing Email Message
An unhandled exception occurred while executing this action: System.Net.Mail.SmtpException: The operation has timed out.
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at Inedo.BuildMaster.Extensibility.Actions.ActionBase.ExecuteInternal(IActionExecutionContext context, ExtensionConfigurerBase extensionConfigurer, Boolean resumeNextOnError, Boolean logErrorsAsWarnings)
Deployments are failing on the Send Email step most of the time (but not always). However, the emails are still being sent -- the failure reported by BuildMaster is not really correct. So that's one area where I need to understand what is really happening -- the email is, in fact, being sent. It's just that BuildMaster thinks there is a timeout and then it fails the step. What is going on there?
To handle this, I thought I would go to the advanced options of the Send Email step and set the Timeout to 30 seconds, thinking it would then wait 30 seconds before "failing". This didn't seem to have any effect. It would still "fail" after like 15 seconds. Does that Timeout value not work the way I expect?
I also tried setting the Retry Count to 3, thinking that it would at least take 3 "timeouts" to cause the step to fail. It merely resulted in two failures and then on the third attempt, a success. Everyone got three emails, though.
Any advice on how to handle this? We are using Exchange.