从多个地址发送电子邮件 [英] Send Email from multiple address

查看:97
本文介绍了从多个地址发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我一直在尝试从电子邮件中的不同地址发送电子邮件。但是当它发送时只选择其中一个。


  MailMessage mail = new MailMessage();


             mail.From = new MailAddress(" email1; email2; email3; email4");


             mail.To.Add(label2.Text);


             mail.Subject = label4.Text;


             mail.Body ="" + label5.Text +"" + label9.Text +" \ n"


                 +"" + label6.Text +"" + label10.Text +" \ n"


                 +"" + label7.Text +"" + label11.Text +" \ n"


                 +"" + label12.Text +"" + textBox2.Text +" \ n"


                 +"" + label8.Text +" \ n" + textBox1.Text;


 


我有什么方法可以从C~

<中的4个不同地址发送div class ="h2_lin">解决方案

为什么不迭代电子邮件地址,然后单独发送?


ie


 
foreach string 地址 地址)
{
SendMail(地址);
}


Hi,

i have been trying to send an email from different address in the email., but when it send it only select one of them.

 MailMessage mail = new MailMessage();

            mail.From = new MailAddress("email1; email2; email3; email4");

            mail.To.Add(label2.Text);

            mail.Subject = label4.Text;

            mail.Body = "" +label5.Text+""+label9.Text+"\n"

                +""+label6.Text+ "" +label10.Text+ "\n"

                +""+label7.Text+ "" +label11.Text+ "\n"

                +""+label12.Text+ "" +textBox2.Text+ "\n"

                +""+label8.Text+ "\n" +textBox1.Text;

 

is there any way that i can and send from 4 different address in C~

解决方案

Why not iterate over the email addresses, and send each individually?

i.e.

foreach(string address in Addresses)
{
  SendMail(address);
}


这篇关于从多个地址发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆