I have this method here, I wanted to go e.Mail.To = MAC, but apparently this is a read-only property that leaves me completely at a standstill on how I can programmatically set recipients. Basically I want to change the address based on my deployment level (live / test / dev). I also want to send () (not send) an email to dev / test.
Is there another way?
public static void ErrorMail_Mailing(object sender, ErrorMailEventArgs e)
{
if (!GlobalHelper.IsLiveMode)
{
e.Mail.Dispose();
}
else
{
MailAddressCollection MAC = new MailAddressCollection();
MAC.Add("A");
}
source
share