C
Crespo
hi,everybody
I use dotnet 2005 and c sharp to deliever a mail to a certain mail
address,but it failed with messages such as "invalid parameter,the server
response: decode failed". My codes is listed belowed:
try
{
MailMessage mailObj = new MailMessage();
mailObj.To.Add("(e-mail address removed)");
mailObj.From = new MailAddress([email protected]);
mailObj.Subject = "Óʼþ²âÊÔ";
mailObj.Body = "ºÍѶÓʼþ½ÓÊÕ²âÊԳɹ¦! ";
mailObj.IsBodyHtml = true;
mailObj.Priority = MailPriority.High;
mailObj.BodyEncoding = System.Text.Encoding.UTF8;
System.Net.Mail.SmtpClient client = new
System.Net.Mail.SmtpClient("smtp.21cn.com");
client.UseDefaultCredentials = false;
client.Credentials = new
System.Net.NetworkCredential("(e-mail address removed)",
this.tb_mailUserPassword.Text);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(mailObj);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return;
}
(e-mail address removed) is a correct account of mail.21cn.com,Could anyone
help me?
Crespo
2006-06-30
I use dotnet 2005 and c sharp to deliever a mail to a certain mail
address,but it failed with messages such as "invalid parameter,the server
response: decode failed". My codes is listed belowed:
try
{
MailMessage mailObj = new MailMessage();
mailObj.To.Add("(e-mail address removed)");
mailObj.From = new MailAddress([email protected]);
mailObj.Subject = "Óʼþ²âÊÔ";
mailObj.Body = "ºÍѶÓʼþ½ÓÊÕ²âÊԳɹ¦! ";
mailObj.IsBodyHtml = true;
mailObj.Priority = MailPriority.High;
mailObj.BodyEncoding = System.Text.Encoding.UTF8;
System.Net.Mail.SmtpClient client = new
System.Net.Mail.SmtpClient("smtp.21cn.com");
client.UseDefaultCredentials = false;
client.Credentials = new
System.Net.NetworkCredential("(e-mail address removed)",
this.tb_mailUserPassword.Text);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(mailObj);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString());
return;
}
(e-mail address removed) is a correct account of mail.21cn.com,Could anyone
help me?
Crespo
2006-06-30