Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
There is a bug in the EmailHelper SendAsync method. If there is no mail server configured, often the case using IIS express in dev environments, the when calling smtp.Send() it will throw an error and cause the server to crash.
At present the method looks like this:
private static void SendAsync(object o) { SmtpClient smtp = ((dynamic)o).smtp; MailMessage message = ((dynamic)o).message; smtp.Send(message); }
The revised version should look like this:
private static void SendAsync(object o) { SmtpClient smtp = ((dynamic)o).smtp; MailMessage message = ((dynamic)o).message; try { smtp.Send(message); } catch (Exception ex) { // log exception here! Log.Add(LogTypes.Error, -1, ex.Message); } }
This will fix the issue.
Thanks.
I normally specify a mail drop folder when developing:
<mailSettings> <smtp deliveryMethod="specifiedPickupDirectory"> <specifiedPickupDirectory pickupDirectoryLocation="c:\maildrop" /> </smtp> </mailSettings>
http://msdn.microsoft.com/en-us/library/ms164241.aspx
For those that do not, having the server just go away is kind of mystifying.
You do have the the synchronous method wrapped, so wrapping the asyc one wouldn't be much of a stretch. :)
It's now on the youtrack list ;)
Patch will be in the next version of ublogsy
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
EmailHelper SendAsync bug
There is a bug in the EmailHelper SendAsync method. If there is no mail server configured, often the case using IIS express in dev environments, the when calling smtp.Send() it will throw an error and cause the server to crash.
At present the method looks like this:
The revised version should look like this:
Thanks.
I normally specify a mail drop folder when developing:
http://msdn.microsoft.com/en-us/library/ms164241.aspx
For those that do not, having the server just go away is kind of mystifying.
You do have the the synchronous method wrapped, so wrapping the asyc one wouldn't be much of a stretch. :)
It's now on the youtrack list ;)
Patch will be in the next version of ublogsy
is working on a reply...