Configuring ELMAH to send emails without putting your password in the config file
2014-07-09 01:22
627 查看
http://blog.dantup.com/2011/05/configuring-elmah-to-send-emails-without-putting-your-password-in-the-config-file/
Today I was configuring ELMAH to send emails when an exception occurs on my new blog. While looking for the config options, I noticed that a lot of the snippets being posted around suggests people are putting usernames and passwords in their config
files to make this work. That's pretty scary! :(
Because SMTP is a bit crap, you don't actually need to authenticate to send email. Most SMTP servers are locked down to stop relaying, but if you deliver directly to the recipients server, the mail will (usually) be accepted anonymously. I sayusually because
your email could be rejected based on the From header if something like DomainKeys is set up for that domain.
To configure ELMAH to send mail without authentication, simply look up an MX record for the domain you wish to send the email to, and use that as the SMTP Server. Eg., if you're using Google Apps (like me), you could do something like this:
This means you don't need to put your email username/password in the config file to receive emails about your exceptions.
Today I was configuring ELMAH to send emails when an exception occurs on my new blog. While looking for the config options, I noticed that a lot of the snippets being posted around suggests people are putting usernames and passwords in their config
files to make this work. That's pretty scary! :(
Because SMTP is a bit crap, you don't actually need to authenticate to send email. Most SMTP servers are locked down to stop relaying, but if you deliver directly to the recipients server, the mail will (usually) be accepted anonymously. I sayusually because
your email could be rejected based on the From header if something like DomainKeys is set up for that domain.
To configure ELMAH to send mail without authentication, simply look up an MX record for the domain you wish to send the email to, and use that as the SMTP Server. Eg., if you're using Google Apps (like me), you could do something like this:
<errorMail from=""Blog Error;quot; <blog+errors@fakedomain.com>" to=""Blog Errors" <blog+errors@fakedomain.com>" smtpServer="aspmx.l.google.com" />
This means you don't need to put your email username/password in the config file to receive emails about your exceptions.
相关文章推荐
- method to The entitlements specified in your application’s Code Signing Entitlements file do not mat
- mySql主从配置出错:The server is not configured as slave; fix in config file or with CHANGE MASTER TO
- Your Podfile has had smart quotes sanitised. To avoid issues in the
- Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextE
- Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextE
- nrf51822 secure DFU by OTA: How to Set Password in the DFU zip File
- Where is the best place to store a password in your Android app
- Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextE
- Mysql 出现错误The server is not configured as slave; fix in config file or with CHANGE MASTER TO
- 4 ways to send a PDF file to the IE Client in ASP.NET 2.0
- 4 ways to send a PDF file to the IE Client in ASP.NET 2.0
- How to Modify the web.config file in SharePoint using SPWebConfigModification?
- Please change the value of 'Security.salt' in app/config/core.php to a salt value specific to your a
- 使用cocapods报错 [!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes
- 35.You executed the command to create a password file in the database server:
- 126.Identify the two situations in which you use the alert log file in your database to check the de
- BI Java 补丁错误处理 :Cannot login to the SAP J2EE Engine using user and password as provided in the Filesystem Secure Store. Enter va
- [Python] Send emails to the recepients specified in Message["CC"]
- 奇葩问题:This file could not be checked in because the original version of the file on the server was moved or deleted. A new version of this file has been saved to the server, but your check-in comments were not saved
- .NET错误The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework