Thanks for your question.
There is a way to set an address that doesn't have a domain name. Just use the Rebex.Mime.Headers.MailAddress
class and its MailAddress(address, displayName)
constructor like this:
MailMessage mail = new MailMessage();
mail.Subject = "subject";
mail.BodyText = "text";
mail.From = new MailAddress("foo", null);
mail.To = new MailAddress("boo", null);
Smtp.Send(mail, "serverName");
Does it work for you now?
The problem is that when setting the sender like this:
mail.From = "foo";
we process the string "foo" as being the displayName, not the email address. Thus later on, when the MailMessage is being sent and the sender's addresses are looked up, there is a header which contains no email address, only the name "foo". So the ArgumentException is thrown at this point. We will consider whether throwing an SmtpException would be better at this point.
Update: The exceptions were fixed in Rebex Secure Mail 2012 R3.
By the way, you can also use this code to parse "foo" as email address:
mail.From = "<foo>";