我在C#中使用smtp发送邮件。我必须将它发送到多个电子邮件ID。我可以这样做:
MailMessage mailMessage = new MailMessage();
mailMessage.To.Add(strEmailTo);
mailMessage.To.Add(strAdminEmailId);
mailMessage.From = new MailAddress(strEmailFrom, strDisplayName);
mailMessage.Subject = strEmailSubject;
mailMessage.Body = //needs to vary for every recipient
mailMessage.To.Add("1@gmail.com");
mailMessage.To.Add("2@gmail.com");
现在问题是,我还需要为每个收件人更改邮件正文。有没有办法只为每个收件人更改身体或我是否重复了一切?