1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
String from "jackiechang@hotmail.com";
String to = "elvispreslay@hotmail.com";
String subject = "sujet de mon email";
String body = textbox1.text + textbox2.text;
Boolean IsBodyHtml = true;
String CC = "billgates@hotmail.com;steeveballmer@hotmail.com";
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from, to, subject, body);
message.IsBodyHtml = true;
if (CC != "")
{
String[] CCs = CC.Split(Convert.ToChar(";"));
foreach (String _cc in CCs)
{
message.CC.Add(_cc);
}
}
System.Net.Mail.SmtpClient client = new
//le serveur smtp de ton fai
//le port smtp de ton fai
System.Net.Mail.SmtpClient("serveur mail fai", 25));
client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
// try
// {
client.Send(message);
// }
// catch (Exception ex)
// {
// } |