Following piece of code wil let u send email using google server
just replace network credentials with your google username, password,
MailAddress mafrom = new MailAddress("mani@abc.com");
MailAddress mato = new MailAddress("dontumindit@yahoo.com");
MailMessage mymsg = new MailMessage(mafrom, mato);
mymsg.Subject = "hy";
mymsg.Body = "How are You";
SmtpClient smptc = new SmtpClient("smtp.gmail.com", 587);
smptc.UseDefaultCredentials = false;
smptc.EnableSsl = true;
smptc.Credentials = new NetworkCredential("username", "password");
smptc.Send(mymsg);
Before providing Credentials, You need to set UserDefaultCredentials to false.
I have tested this code and used it to send mails, Even i have tried sending emails with attachments, and it works.
Have Nice Time.