bool SendMail (string strFromEMail, string strFromName, string strPass, string strToEMail, string strToName string strSub, string strBody)
{
SmtpClient smtpClient = new SmtpClient( "smtp.gmail.com", 465 );
System.Net.NetworkCredential credentials = null ;
bool bSuccess = true ;
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress(strFromEMail, strFromName );
MailAddress toAddress = new MailAddress (strToEMail, strToName);
message.From = fromAddress;
message.To.Add(toAddress);
message.Subject = strSub;
message.IsBodyHtml = true;
credentials = new System.Net.NetworkCredential( strFromEMail, strPass);
smtpClient.Credentials = credentials;
smtpClient.Send(message);
}
catch ( Exception eX )
{
bSuccess = false ;
}
return bSuccess ;
}