.Net System.Mail.Message adding multiple “To” addresses

前端 未结 8 1368
悲&欢浪女
悲&欢浪女 2020-12-30 18:56

EDIT: This question is pointless, except as an exercise in red herrings. The issue turned out to be a combination of my idiocy (NO ONE was being emailed as the hos

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-30 19:28

    You could try putting the e-mails into a comma-delimited string ("person1@domain.com, person2@domain.com"):

    C#:

    ArrayList arEmails = new ArrayList();
    arEmails.Add("person1@domain.com");
    arEmails.Add("person2@domain.com");
               
    string strEmails = string.Join(", ", arEmails);
    

    VB.NET if you're interested:

    Dim arEmails As New ArrayList
    arEmails.Add("person1@domain.com")
    arEmails.Add("person2@domain.com")
    
    Dim strEmails As String = String.Join(", ", arEmails)
    

提交回复
热议问题