To send emails, use VS 2010 SMTP. You define related parameters in the .config as follows:
<pre><system.net>
<mailSettings>
<smtp from="youremail@yourdomain.com">
<network host="mail.yourdomain.com" port="yourport" userName="youremail@yourdomain.com" password="yourpassword" defaultCredentials="false"/>
</smtp>
</mailSettings>
</system.net>
As an example of the C# code to send emails:
public static void Send(string Subject, string From, string Body, List<emailAddress> CC, MailAddress To, bool BodyHTML)
{
try
{
MailMessage mail = new MailMessage();
if (CC != null)
{
foreach (emailAddress ea in CC)
{
mail.CC.Add(new MailAddress(ea.email, ea.fullname));
}
}
mail.Subject = Subject;
mail.Body = Body;
mail.IsBodyHtml = BodyHTML;
mail.From = new MailAddress(From);
mail.To.Add(To);
SmtpClient client = new SmtpClient();
client.Host = "mail.yourdomain.com";
client.Send(mail);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}