string body = "有新的定单";
SmtpClient smpt = new SmtpClient("*.*.*.*");        
MailAddress from=new MailAddress("[email protected]") ;
MailAddress To = new MailAddress("[email protected]");
MailMessage mail = new MailMessage(from,To);
mail.Subject = "定单";
mail.Body = body;
mail.Attachments.Add(new Attachment(path));
mail.Priority = MailPriority.High;
smpt.Send(mail);
在这段代码中我要实现把邮件发送给多个地址,该怎么弄 各位高手帮忙说说

解决方案 »

  1.   

    mail.to = "邮件列表,中间用分号"
    不要用下面这样,麻烦,还要创建对象:
    MailAddress from=new MailAddress("[email protected]") ;
    MailAddress To = new MailAddress("[email protected]");
      

  2.   

    可是我那样做 就报错说
    无法将类型“string”隐式转换为“System.Net.Mail.MailAddress”
      

  3.   

    objMessage=new MailMessage();
    objMessage.To=strTo;不行吗? 我一直这样用.
      

  4.   

    不行呀 他就是报 无法将类型“string”隐式转换为“System.Net.Mail.MailAddress”的错
      

  5.   

    string body = "有新的定单";
    SmtpClient smpt = new SmtpClient("*.*.*.*");  
    MailMessage mail = new MailMessage();
    mail.Subject = "定单";
    mail.Body = body;mail.From = "[email protected],[email protected]";
    mail.To = "[email protected],[email protected]";mail.Attachments.Add(new Attachment(path));
    mail.Priority = MailPriority.High;
    smpt.Send(mail);
      

  6.   

    实在没办法, 你用一个循环一份一份的发送吧.
    while(count>0)
    {
    mail.to = new MailAddress("[email protected]");
    mail.send();
    count--;
    }
      

  7.   


    while(count>0)
    {
    mail.to = new MailAddress("[email protected]");
    smpt.Send(mail);
    count--;
    }这样也不行吗?
    没理由啊?