We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Parameter name: Username should not be null

I just downloaded Aspose.Network Version and I created a simple .Net 2.0 console app to email out a test message.

Here is the code snippet:

//Create the MailMessage Instance
MailMessage msg = new MailMessage("user@somecompany.com","user@somecompany.com","Test","hello, how are you?");

//Send it
SmtpClient client;
client = new SmtpClient("localhost");


catch (Exception ex)

When you don't specify a username in the SmtpClient object, then following error occurs:

Value cannot be null.
Parameter name: Username should not be null

This is a problem. Can you review this and see if it's a problem?


if you set client.AuthenticationMethod = SmtpAuthenication.None then you do not get the error and the message is sent.


The exception is thrown when you don't set the username for the smtp connection to the server.