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.