带有停用代码的多个收件人的电子邮件 [英] Email with multiple receipients with deactivation code
问题描述
嗨;
我正在网上购物网站。在这个网站上我有电子邮件新闻订阅表格。
在管理方面,管理员可以从网格中选择多个电子邮件用msg和内容发送。我想发送包含新闻订阅停用代码的内容。
在我的表格中我使用以下代码
protected void dlContactus_ItemCommand(object source,DataListCommandEventArgs e)
{
blErr.Items.Clear();
开关(e.CommandName)
{
案例发送:
CheckBox chk;
HiddenField hd;
StringBuilder sb = new StringBuilder();
foreach(dlContactus.Items中的DataListItem项)
{
chk =(CheckBox)item.FindControl(chk);
如果(chk == null)
继续;
如果(chk.Checked == false)
继续;
hd =(HiddenField)item.FindControl(hd);
sb.AppendFormat({0};,hd.Value);
}
if(sb.ToString()!= string.Empty)
{
string strTo = sb.ToString();
if(strTo.Substring(strTo。长度 - 1,1)==,)
strTo = strTo.Remove(strTo.Length - 1,1);
string Body = txtContent.Text
Common.SendBulkMail(ConfigurationManager.AppSettings [_ ADMIN_MAIL_ID],strTo,txtSubject.Value,正文,真实,虚假);
blErr.Items.Add(通讯发送给选定的客户);
}
e lse
{
blErr.Items.Add(未选择电子邮件地址);
}
休息;
}
}
.....................
i希望向相应的用户发送带有http://site/page.aspx?id = email等停用代码的内容。每个用户都有单独的停用代码。
如果我为每个用户使用发送功能需要很多时间。快速完成任务的方法。
Hi;
I am doing online shopping site.In this site i have email news subscription form.
In admin side, admin can select multiple emails from grid and send with msg and content. I want to send content with news subscription deactivation code.
In my form i use following code
protected void dlContactus_ItemCommand(object source, DataListCommandEventArgs e)
{
blErr.Items.Clear();
switch (e.CommandName)
{
case "SEND":
CheckBox chk;
HiddenField hd;
StringBuilder sb = new StringBuilder();
foreach (DataListItem item in dlContactus.Items)
{
chk = (CheckBox)item.FindControl("chk");
if (chk == null)
continue;
if (chk.Checked == false)
continue;
hd = (HiddenField)item.FindControl("hd");
sb.AppendFormat("{0};", hd.Value);
}
if (sb.ToString() != string.Empty)
{
string strTo = sb.ToString();
if (strTo.Substring(strTo.Length - 1, 1) == ",")
strTo = strTo.Remove(strTo.Length - 1, 1);
string Body = txtContent.Text
Common.SendBulkMail(ConfigurationManager.AppSettings["_ADMIN_MAIL_ID"], strTo, txtSubject.Value, Body, true, false);
blErr.Items.Add("Newsletter send to selected customers");
}
else
{
blErr.Items.Add("Email addresses not selected");
}
break;
}
}
.....................
i want to send content with deactivation code like "http://site/page.aspx?id=email" to corresponding users. each user has seperate deactivation code.
if i use send function for each user it takes lot of time.any method to do it fast.
推荐答案
如果每个用户的代码不同,原则上它不能是多个收件人电子邮件。每个用户都应该收到单独的消息。就如此容易。尽可能快。 :-)
至于性能,你会浪费时间撰写邮件,这与发送邮件无关。您只需要编写一次消息,并且对于每次发送,只需快速插入两个(左右)参数:To地址和停用代码。一条消息不是一块纯文本,所以你总能做到。
-SA
If the code is different for each user, it cannot be a "multiple recipient e-mail" in principle. Each user should get a separate message. As simple as that. And as fast as it can be. :-)
As to the performance, you waste time on composing a message, which has nothing to do with sending it. You need to compose a message just once, and for each send, just quickly insert two (or so) parameters: "To" address and deactivation code. A message is nothing by a block of plain text, so you always can do it.
—SA
>
这篇关于带有停用代码的多个收件人的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!