Actually This Works :
try
{
SmtpClient mailClient;
mailClient = new SmtpClient("smtp.gmail.com", 587);
mailClient.EnableSsl = true;
System.Net.Mail.MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress("FROMADDRESS@gmail.com");
mailMessage.To.Add(to);
string fileLoc = @"C:\Users\LUCKY\Desktop\Hello.txt";
mailMessage.Subject = subject;
mailMessage.Body = body;
mailMessage.IsBodyHtml = isBodyHtml;
mailMessage.Priority = mailPriority;
mailClient.Send(mailMessage);
return true;
}
catch (Exception ex)
{
return false;
}
This is works fine , but requires gmail account (id & pwd) for sending mail using Gmail SMTP Server.
WHat if i don't wanna use Gmail's Server and instead use the one provided by Windows 7 as localhost ..
Best Regards
Thanks .
-Live Lucky :)Ω