Using a managed service account to send Elmah emails

28 views
Skip to first unread message

AlexC

unread,
Jul 9, 2019, 1:39:19 PM7/9/19
to ELMAH
Hi. Love Elmah and have been using it for years! Is it possible to use a Windows managed service account to send Elmah emails? What would the errorEmail look like in Web.config? 

<elmah>
<errorMail from="some...@mydomain.com" to="some...@mydomain.com" async="true" subject="MyApp Exception thrown: {0}" userName="some...@mydomain.com" password="" smtpServer="smtp.mydomain.org"/>
</elmah>

Thank you.

Atif Aziz

unread,
Jul 9, 2019, 1:42:27 PM7/9/19
to el...@googlegroups.com
I don't think this is specific to ELMAH so you'll have better luck getting an answer quicker on StackOverflow. It wouldn't be any different thank asking, “How can I send e-mail in .NET using a Windows managed service account?”

- Atif

--
You received this message because you are subscribed to the Google Groups "ELMAH" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elmah+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elmah/1499c8d8-7832-4f09-92ad-37979d8a96a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

AlexC

unread,
Jul 9, 2019, 1:58:18 PM7/9/19
to ELMAH
Thanks, Atif. You're quick to answer! Much appreciated.

- Alex


On Tuesday, July 9, 2019 at 1:39:19 PM UTC-4, AlexC wrote:
Hi. Love Elmah and have been using it for years! Is it possible to use a Windows managed service account to send Elmah emails? What would the errorEmail look like in Web.config? 

<elmah>
<errorMail from="some...@mydomain.com" to="some...@mydomain.com" async="true" subject="MyApp Exception thrown: {0}" userName="someemail@mydomain.com" password="" smtpServer="smtp.mydomain.org"/>
</elmah>

Thank you.

Atif Aziz

unread,
Jul 9, 2019, 4:27:29 PM7/9/19
to el...@googlegroups.com
If you get an answer on StackOverflow then would appreciate if you could pop back here to drop a note with a link to the solution that worked for you (for future visitors).

Thanks & good luck,
Atif

On Tue, Jul 9, 2019 at 7:58 PM AlexC <coug...@gmail.com> wrote:
Thanks, Atif. You're quick to answer! Much appreciated.

- Alex

On Tuesday, July 9, 2019 at 1:39:19 PM UTC-4, AlexC wrote:
Hi. Love Elmah and have been using it for years! Is it possible to use a Windows managed service account to send Elmah emails? What would the errorEmail look like in Web.config? 

<elmah>
<errorMail from="some...@mydomain.com" to="some...@mydomain.com" async="true" subject="MyApp Exception thrown: {0}" userName="some...@mydomain.com" password="" smtpServer="smtp.mydomain.org"/>
</elmah>

Thank you.

--
You received this message because you are subscribed to the Google Groups "ELMAH" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elmah+un...@googlegroups.com.

AlexC

unread,
Jul 11, 2019, 1:15:38 PM7/11/19
to ELMAH
Hi friends, no answer on StackOverflow but our Ops folks discovered a simple solution: don't include the credentials in the errorMail properties:

  <elmah>
        <errorMail from="noreply@mydomain.com" to="some...@mydomain.com" async="true" subject="MyApp Exception thrown: {0}" smtpServer="smtp.mydomain.org"/>
 </elmah>

Note we also changed the "from" to a fake "noreply" email, as we don't wan't replies. Also, we can't use a Win service account to send emails, as described here: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/ff641729(v=ws.10)#supported-technologies

Exchange Server does not allow you to send e-mails from a managed service account on behalf of a service or application. To overcome this limitation, use the managed service account to run the service, but create a separate conventional user account for the service and configure the service to send e-mails using this account.

Hope this helps someone else. 

On Tuesday, July 9, 2019 at 1:39:19 PM UTC-4, AlexC wrote:
Hi. Love Elmah and have been using it for years! Is it possible to use a Windows managed service account to send Elmah emails? What would the errorEmail look like in Web.config? 

<elmah>
<errorMail from="some...@mydomain.com" to="some...@mydomain.com" async="true" subject="MyApp Exception thrown: {0}" userName="someemail@mydomain.com" password="" smtpServer="smtp.mydomain.org"/>
</elmah>

Thank you.

Atif Aziz

unread,
Jul 11, 2019, 2:15:51 PM7/11/19
to el...@googlegroups.com
Alex, thanks a ton for taking the time to revert with the solution that worked for you!

- Atif
--
You received this message because you are subscribed to the Google Groups "ELMAH" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elmah+un...@googlegroups.com.

AlexC

unread,
Jul 11, 2019, 2:20:57 PM7/11/19
to ELMAH
You're welcome, Atif. And thank you for the amazing ELMAH! First used it with .NET 2.0 years ago and rediscovered it recently.


On Tuesday, July 9, 2019 at 1:39:19 PM UTC-4, AlexC wrote:
Hi. Love Elmah and have been using it for years! Is it possible to use a Windows managed service account to send Elmah emails? What would the errorEmail look like in Web.config? 

<elmah>
<errorMail from="some...@mydomain.com" to="some...@mydomain.com" async="true" subject="MyApp Exception thrown: {0}" userName="someemail@mydomain.com" password="" smtpServer="smtp.mydomain.org"/>
</elmah>

Thank you.
Reply all
Reply to author
Forward
0 new messages