private void MailSend()
{
try
{
string mailFrom = "sender_email@yahoo_or_gmail.com";
string mailTo = "receiver_email@yahoo_or_gmail.com";
string mailBody = GetHTML();
string mailSubject = "Sample Email Send::Please click for download file";
string stmpMailId = "your_stmp_mail@gmail.com";
string stmpMailPass = "passowrd";
MailMessage message = new MailMessage();
SmtpClient smtpClient = new SmtpClient();
string msg = string.Empty;
try
{
MailAddress fromAddress = new MailAddress(fromMail);
message.From = fromAddress;
message.To.Add(toMail);
message.Subject = subjectMail;
message.IsBodyHtml = true;
message.Body = body;
smtpClient.Host = "smtp.gmail.com";
smtpClient.Port = 587;
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = true;
smtpClient.Credentials = new System.Net.NetworkCredential(stmpUserId, stmpPassword);
smtpClient.Send(message);
msg = "Successful<br>";
}
catch (Exception ex)
{
msg = ex.Message;
}
}
catch (Exception ex)
{
}
}
private string GetHTML()
{
string htmlBody = "<html><head><title></title></head><body>This solution is from codeproject.com. I am Md. Humayun Rashed. Please attach your document like this link: "
+"<a href="http:
return htmlBody;
}</br>