Dear Arun,
Make sure you are using System.Net. Tested and the easiest way to send mail is following:
MailMessage MyMM = new MailMessage("fromabc@gmail.com", "toxyz@gmail.com", "subject", "body");
Attachment MyAttachment = new Attachment(filename);
MyMM.Attachments.Add(MyAttachment);
MyMM.IsBodyHtml= true;
SmtpClient MySC = new SmtpClient("smtp.gmail.com",587);
MySC.EnableSsl=true;
MySC.Send(MyMM);
Do not forget to establish mailsetting in Web.config underlying system.net tag. e.g.
<system.net>
<mailSettings>
<smtp from="fromabc@gmail.com" deliveryMethod="Network">
<network host="smtp.gmail.com" port="587" userName="fromabc@gmail.com" password="1234AA88"/>
</smtp>
</mailSettings>
</system.net>
I hope it will help you.
Regards!
Aman