asked on
MailAddress from = new MailAddress(From);
MailAddress to = new MailAddress(To);
MailMessage mail = new MailMessage(from , to);
if (Cc.Length > 0)
{
MailAddress copy = new MailAddress(Cc);
mail.CC.Add(copy);
}
if (Bcc.Length > 0)
{
MailAddress bcopy = new MailAddress(Bcc);
mail.Bcc.Add(bcopy);
}
if (Subject.Length > 0)
{
mail.Subject = Subject;
}
if (Body.Length > 0)
{
mail.Body = Body;
}
mail.IsBodyHtml = true;
//Send the message.
SmtpClient client = new SmtpClient(GetSmtpServer());
client.Send(mail);
}
C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).
TRUSTED BY