Email with attachment functionality in windows phone 8

Jul 24, 2013 at 7:26 AM
Edited Jul 24, 2013 at 2:29 PM
Hi,

we have downloaded the "WP7Mail" dll and used in my code.
we have prepared Mailmessage and we are trying to send the mail with attachment using SmtpClient which already provided in "WP7Mail" dll.
we are trying to send the mail like below

WP7Mail.Net.MailMessage Mmessage = new WP7Mail.Net.MailMessage("User name", "Mail Id", "Mail ID", "testing subject");
Mmessage.AddAttachment(Imagebyetes, "Sample image", "image/png");
Mmessage.AddMessageContent("sample description");
SmtpClient client = new SmtpClient();
client.SendMail(Mmessage);

but we are getting error at this line "client.SendMail(Mmessage)"
Error is: object refernce not set to instance of an object.

here we are not able to connect SmtpClient.Authenticate(usermail,authValue);
Error: Client not connected.

please suggest us