I am using System.Net.Mail.MailMessage to create and send an email message. For various reasons I do not want to use the .To.Add() or the .CC.Add() or the .Bcc.Add() methods to add recipients to the email. I want to add them via the .Headers.Add() method. (This gives greater control over the recipients).
However, when I come to send the message I get an exception stating "A recipient must be specified". It obviously does not realise that I have added recipients via the Headers.
Can anyone think of a workaround for this? Could I somehow override the method that is validating the message and throwing the exception?
Thanks very much.