c# SmtpClient is quite right for your needs. here's some sample code (host is an ip address or host name, and the port is usually 25, but not necessarily) :
public static void SendMail(
string host,
int port,
SmtpAuthentication authentication,
string userName,
string password,
string from,
string to,
string cc,
string subject,
string body,
string[] attachments)
{
// Create and configure the smtp client
SmtpClient smtpClient = new SmtpClient();
if (host != null && host.Length > 0)
{
smtpClient.Host = host;
}
smtpClient.Port = port;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
if (authentication == SmtpAuthentication.Basic)
{
// Perform basic authentication
smtpClient.Credentials = new System.Net.NetworkCredential(userName, password);
}
else if (authentication == SmtpAuthentication.Ntlm)
{
// Perform integrated authentication (NTLM)
smtpClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
}
MailMessage mailMessage = new MailMessage();
mailMessage.Body = body;
mailMessage.From = new MailAddress(from);
mailMessage.To.Add(to);
mailMessage.CC.Add(cc);
foreach (string attachement in attachments)
{
mailMessage.Attachments.Add(new Attachment(attachement));
}
mailMessage.Subject = subject;
mailMessage.Priority = MailPriority.Normal;
smtpClient.Send(mailMessage);
}
}