Any way to divert all email bound for real users to a fake/test email. We just had a flood of emails go out on a test import. But we would like to be able to see the emails the system wants to send. Not just turn the whole thing off.
Any way to divert all email bound for real users to a fake/test email. We just had a flood of emails go out on a test import. But we would like to be able to see the emails the system wants to send. Not just turn the whole thing off.
Assuming this happened on a test instance, probably the best way to prevent emails to real addresses is to run the following scrub script on your test db:
update dbo.aspnet_Membership set Email = email + '.bounce', LoweredEmail = LoweredEmail + '.bounce', PasswordFormat = 0,Password ='password' update dbo.cs_Users set Email = Email + '.bounce' update dbo.cs_SiteSettings set SettingsXML = REPLACE(CAST(SettingsXML AS NVARCHAR(MAX)),'<SmtpServer>[YOUR SMTP SERVER ADDRESS]</SmtpServer>', '<SmtpServer>127.0.0.1</SmtpServer>') update dbo.cs_SiteSettings set SettingsXML = REPLACE(CAST(SettingsXML AS NVARCHAR(MAX)),'<SmtpServerUsingNtlm>true</SmtpServerUsingNtlm>', '<SmtpServerUsingNtlm>false</SmtpServerUsingNtlm>') update dbo.cs_SiteSettings set SettingsXML = REPLACE(CAST(SettingsXML AS NVARCHAR(MAX)),'<SmtpServerUserSsl>true</SmtpServerUserSsl>', '<SmtpServerUserSsl>false</SmtpServerUserSsl>') update dbo.cs_SiteSettings set SettingsXML = REPLACE(CAST(SettingsXML AS NVARCHAR(MAX)),'<SmtpServerRequiredLogin>true</SmtpServerRequiredLogin>', '<SmtpServerRequiredLogin>false</SmtpServerRequiredLogin>') update dbo.cs_SiteSettings set SettingsXML = REPLACE(CAST(SettingsXML AS NVARCHAR(MAX)),'<SmtpPortNumber>587</SmtpPortNumber>', '<SmtpPortNumber />')
This should prevent real emails from being sent out. Just make sure this is a backup/test instance of the db.