类似京东,淘宝的广告邮件.里边的最新产品是怎么处理的?
解决方案 »
- 在线拍照的
- (c#) 设定Word模板,获得批量导出数据的效果!
- 无法将类型“System.Data.SqlClient.SqlDataReader”隐式转换为“System.Data.SqlClient.SqlDataAda
- 给gridview中控件赋值
- 将Excel转化为DATATABLE后,需要一行一行的判断其是否符合格式,每判断一行就要与数据库交互一次,是否有优化的方法?
- 阿里巴巴的注册步骤的问题
- sqlconnection控件的问题
- .cs文件中 可不可以使用 session 还有 server 等对象呢?
- 孟子E章请进!
- 登陆后,管理员可以作修改,用户只能浏览,他们的权限该在哪设啊?
- 求各位大侠指点迷津
- 网页地址中如果有中文怎么解码编码?
两侧广告用 自定义控件实现的
把动态生成的HTML当成邮件的内容发出去啊!!产品的图片地址和链接地址都采用绝对地址就可以了!!
{
int NID = int.Parse(Session["NID"].ToString()); //toNames.Add(dar["DName"].ToString());
//toEmails.Add(dar["DEmail"].ToString()); ////获得内容
string topcontent = .BLL.NewLetterBLL.GetTopContent(NID);
string rightcontent = .BLL.NewLetterBLL.GetRightContent(NID);
string title = .BLL.NewLetterBLL.GetTitle(NID);
string content = .BLL.NewLetterBLL.GetContent(NID);
string downcontent = .BLL.NewLetterBLL.GetDownContent(NID);
////结束
string body = string.Empty;
jmail.MessageClass mail = new jmail.MessageClass();
body += "<!DOCTYPE html PUBLIC ' -//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";
body += "<html xmlns='http://www.w3.org/1999/xhtml'>";
body += "<head>";
body += "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
body += "<title>newsletter</title>";
body += "<style type='text/css'>";
body += "body {background-color: #808080;margin-left: 17px;margin-top: 21px;margin-right: 0px;margin-bottom: 0px;}";
body += ".STYLE1 {font-family: Arial,'宋体';font-size: 12px;font-weight: normal;color: #000000;line-height: 18px;}";
body += ".STYLE2 {font-family: Arial, '宋体';font-size: 14px; font-weight: bold; color: #000000; line-height: 18px; }";
body += "</style></head>";
body += "<body>";
body += "<table width='987' border='0' cellspacing='0' cellpadding='0'>";
body += "<tr>";
body += "<td><table width='987' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'>";
body += " <tr>";
body += "<td width='109' valign='top'><img src='http://.com/images/newsletter-style_061.jpg' width='109' height='92' /></td>";
body += "<td width='895' valign='top'><table width='878' border='0' cellspacing='0' cellpadding='0'>";
body += "<tr>";
body += "<td height='25' colspan='2'> </td>";
body += "</tr>";
body += " <td width='18'> </td>";
body += "<td colspan='2'><span class='STYLE1'>" + topcontent + "</span></td>";
body += "</tr>";
body += "<tr>";
body += "<td colspan='3'><table width='555' height='75' border='0' cellpadding='0' cellspacing='0'>";
body += "<tr>";
body += "<td width='18'> </td>";
body += "<td width='510' valign='top' class='STYLE1'> </td>";
body += "<td width='27'> </td>";
body += " </tr>";
body += " </table></td>";
body += "</tr>";
body += "<tr>";
body += "<td class='STYLE1'> </td>";
body += "<td width='84' class='STYLE1'> </td>";
body += " <td width='453' class='STYLE1'><a href='http://www..com/Forward.aspx?NID=" + NID + "' class='link_en1'>SEND THIS NEWSLETTER TO MY FRIENDS</a> | <a href='http://www..com/Emial.aspx' class='link_en1'>PAST NEWSLETTERS</a></td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "<tr>";
body += "<td valign='top'><table width='555' border='0' cellspacing='0' cellpadding='0'>";
body += "<tr>";
body += " <td valign='top'><table width='555' border='0' cellpadding='0' cellspacing='0' class='kuang'>";
body += "<tr>";
body += "<td width='19'> </td>";
body += " <td width='531'>" + title + "</td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "<tr>";
body += " <td><table width='555' border='0' cellspacing='0' cellpadding='0'>";
body += "<tr>";
body += "<td colspan='3'><img name='' src='' width='32' height='8' alt='' style='background-color: #FFFFFF' /></td>";
body += "</tr>";
body += "<tr>";
body += " <td width='9'> </td>";
body += "<td width='531'><table width='533' border='0' cellspacing='0' cellpadding='0'>";
body += "<tr>";
body += "<td width='533' class='STYLE1'>" + content + "</td>";
body += "</tr>";
body += " </table></td>";
body += " <td width='15'> </td>";
body += "</tr>";
body += " <tr>";
body += " <td> </td><td> </td><td> </td>";
body += "</tr>";
body += "</table>";
body += " <img name='' src='' width='32' height='5' alt='' style='background-color: #FFFFFF' /></td>";
body += "</tr>";
body += "<tr>";
body += " <td><table width='555' border='0' cellspacing='0' cellpadding='0'>";
body += "<tr>";
body += " <td width='356'> </td>";
body += "<td width='199' valign='bottom' class='STYLE1'></td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "</table></td>";
body += "<td width='11' valign='top' bgcolor='#F6EDED'><img name='' src='' width='11' height='1' alt='' style='background-color: #F6EDED' /></td>";
body += "<td width='303' align='left' valign='top' bgcolor='#F6EDED'><table width='290' height='356' border='0' cellpadding='0' cellspacing='0'>";
body += "<tr><td height='18'> </td></tr>";
body += "<tr>";
body += "<td height='314' valign='top' class='STYLE1'>" + rightcontent + "<br />";
body += "</td>";
body += "</tr>";
body += "<tr><td height='18' valign='bottom'> </td></tr>";
body += "</table></td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += " <tr>";
body += "<td><table width='868' height='14' border='0' cellpadding='0' cellspacing='0'>";
body += "<tr>";
body += "<td valign='middle'><img name='' src='' width='868' height='5' alt='' style='background-color: #808080' /></td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "<tr>";
body += "<td align='left' valign='top' class='kuangtext'>" + downcontent + "</td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "<tr>";
body += " <td><table width='987' border='0' cellspacing='0' cellpadding='0'>";
body += "<tr>";
body += "<td width='109' align='left' valign='top'><img src='http://confuciusprograms.com/images/newsletter-style_17.jpg' width='109' height='20' /></td>";
body += "<td width='878' bgcolor='#FFFFFF'> </td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "<tr>";
body += "<td align='left' valign='top' bgcolor='#808080'><table width='969' height='28' border='0' cellpadding='0' cellspacing='0' class='downtext'> <tr>";
body += "<td width='969'>You received this newsletter message from ConfuciusPrograms.com. Please be assured that we will only use your e-mail address to communicate with you about our educational programs. We do not sell or rent information to third parties.<br />";
body += "This e-mail was sent from an unattended mailbox. Please do not reply. Send any questions to [email protected]<br />";
body += "If you are not interested in these newsletters and you do not mind missing out on valuable information we will be sending in the future, simply click the following <a href='http://www.confuciusprograms.com/UnSubscribe.aspx'>LINK</a>. This newsletter was sent to: " + emails + " </td>";
body += "</tr>";
body += "<tr>";
body += "<td> <div align='center'>© Copyright 2003-2008 Eyes on China Ltd.<br />";
body += "ConfuciusPrograms.com <br />Room 717, Fanli Plaza<br /> No. 22, Chao Wai Da Jie<br />100020 Beijing<br />P.R. China<br />";
body += "For questions regarding the delivery of this Newsletter or regarding Privacy concerns <br />";
body += "please call Confucius Programs at: +86.10.6588.0899</div></td>";
body += "</tr>";
body += "</table></td>";
body += "</tr>";
body += "</table>";
body += "</body>";
body += "</html>";
mail.Charset = "GB2312";// 字符集
// mail.Encoding = "BASE64";//附件的编码格式
mail.ContentType = "text/html";
mail.ISOEncodeHeaders = false;//是否将信头编码成iso-8859-1字符集
//mail.Priority = Convert.ToByte(1);// 优先级
mail.From = "[email protected]";//发送人邮件地址
mail.FromName = "[email protected]";//发送人姓名
mail.Subject = NewsLetter;// 邮件主题
mail.MailServerUserName = "[email protected]";//身份验证的用户名
mail.MailServerPassWord = "8888888888";
mail.AddRecipient(emails, "", "");
mail.Body = body;
mail.Send("mail..com", false);
mail.Close(); }