+1 vote

I’m just getting started using it to send VERP messages. I have a lot of code that creates and formats a System.Net.Mail.MailMessage. What’s the easiest way to convert it to an IMail so that I can use smtpMail.CreateUsingVERP?

by

1 Answer

0 votes
 
Best answer

Hi Bill,

All you need to know about VERP is here:
https://www.limilabs.com/blog/verp-variable-envelope-return-path-net

You can use NetMailMessageConverter to convert from System.Net MailMessage to MailBuilder:

MailBuilder builder = new NetMailMessageConverter()
    .CreateMailBuilder(mailMessage);
IMail mail = builder.Create();

...or directly to IMail:

IMail mail = new NetMailMessageConverter()
    .CreateIMail(mailMessage);
by (301k points)
selected by
...