+1 vote

Could I check if it is possible to send from an invalid email address?

IMail email = Mail.Html(@"<strong>HTML email</strong> with an image. ")
.Subject("3rd Party Test")
.AddVisual("Lemon.jpg")
.SetContentId("lemon@id")
.From( new MailBox("john.leong@local", "John Leong"))

I had an exception that I my email address is invalid and I would like to know if it is possible to override the validation and proceed with an invalid email address.

by (8.8k points)

1 Answer

0 votes
 
Best answer

You can use CreateWithoutValidation method to skip validation:

MailBox m = MailBox.CreateWithoutValidation("john.leong@local", "John Leong");
by (298k points)
selected by
...