string不包含SSIS包中Where,C#的定义,请注意什么?
MailMessage mail = new MailMessage();
mail.From = new MailAddress("info@domain.it", "Prova");
foreach (string recips in email)
{
mail.To.Add(recips);
}
mail.Subject = "PRova";
mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.IsBodyHtml = true;
mail.Body = messaggio;
foreach (string itemurl in file)
{
System.Net.Mail.Attachment attachment;
attachment = new System.Net.Mail.Attachment(itemurl);
mail.Attachments.Add(attachment);
}
SmtpClient smtp = new SmtpClient(server);
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("prova", "prova");
smtp.Send(mail);
答案 0 :(得分:3)
Where
类的string
方法是一种扩展方法,您必须提供它的命名空间。所以你应该添加这个命名空间:
using System.Linq;
答案 1 :(得分:0)
我很好奇出了什么问题:
var bytes = Encoding.ASCII.GetBytes(subjectString.Normalize(NormalizationForm.FormKD));
return Encoding.ASCII.GetString(bytes);