Wednesday, 11 September 2013

MailMessage get error "Object reference not set to an instance of an object"

MailMessage get error "Object reference not set to an instance of an object"

I develop a web form application using ASP.Net C#. I use MailMessage to
send e-mail from a Google account.
MailMessage message = new MailMessage(SendersAddress, ReceiversAddress,
subject, body);
It worked in local but when I upload the code to host it get error "Object
reference not set to an instance of an object". I figure out it get error
at MailMessage.
Please help me solve the problem. Thank you and sorry about my bad English.

No comments:

Post a Comment