我有一个经典的asp应用程序试图在特定事件上发送邮件,这就是代码的用法:
var vStSMTPServer = "http://127.0.0.1"
var vObCDOMsg = Server.CreateObject("CDO.Message");
var vObCDOConf = Server.CreateObject("CDO.Configuration");
var vObCDOFlds = vObCDOConf.Fields;
// Set the CDOSYS configuration fields to use port 25 on the SMTP server.
//With vObCDOFlds
//--these information are being retrieved from db:
vObCDOMsg.Configuration = vObCDOConf;
vObCDOMsg.To = email;
vObCDOMsg.From = frmAddress;
vObCDOMsg.Subject = subject ;
vObCDOMsg.Bcc = bcc
//--this is the body
var body=
body = <link href='http://www.es.com/longh/pages/eventsStyle.css' rel='stylesheet'><style type='text/css'>td{font-family: Arial,Helvetica,Verdana,Geneva,sans-serif;font-size: 9pt;line-height: 14px;color: #313104;}</style></head><body><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td><br /></td></tr><tr><td align='center'><table width='600' cellspacing='0' cellpadding='0' border='0'><tr><td colspan='3' bgcolor='#CBBE92'></td></tr><tr><td rowspan='2' bgcolor='#CBBE92'></td><td><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td colspan='2' width='100%' height='50'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td width='100%' height='33'> </td><td rowspan='2' width='153'><img src='http://www.es.com/longh/images/EStit2.gif' width='153' height='50' border='0' alt=''></td></tr><tr><td width='100%' height='20' bgcolor='#000000' colspan='2'> </td></tr></table></td></tr><tr><td width='140' height='100' align='center' valign='middle' bgcolor='#000000'><img src='http://www.es.com/longh/images/logoHostsmall2.gif' width='179'height='127' border='0' alt=''></td><td width='460' bgcolor='#000000'><img src='http://www.es.com/longh/images/GSQ12.jpg' width='460' height='127' border='0' alt=''></td></tr><tr><td width='140' bgcolor='#000000'> </td><td bgcolor='#000000' height='18'><img src='http://www.es.com/longh/images/spacer.gif' width='1' height='18' border='0' alt=''></td></tr></table></td><td rowspan='2' bgcolor='#CBBE92'></td></tr></table></td></tr><tr><td align='center'><table width='776' cellspacing='0' cellpadding='0' border='0'><tr><td><table width='560' align='center' cellpadding='0' cellspacing='0' border='0'><tr><td><br />Dear " + salutation + "<h5>Marriott Events Preorder</h5></td></tr><tr><td style='text-align: justify;'>We are delighted that you will attend the <font color='#000000'>" + eventname + "</font>on <font color='#000000'>" + eventdate + "</font>.<br /> <br />We would like to provide you with the opportunity to make beverage and special dietary arrangements prior to the event, and have created an online pre-order facility for your convenience.<br /> <br /></td></tr><tr><td>You will need to use the <b>Username:</b> <font color='red'>" + username + "</font> and the <b>Password:</b> <font color='red'>" + password + "</font> to gain access.<br /> <br />Please ensure that you complete your pre-order by <font color='#000000'>" + deadline + "</font>.<br /> <br /><a href='http://www.es.com/longh/?username=" + username + "' style='text-decoration: underline;'>Please click here to Sign In.</a><br /> <br /><i>In case the above link does not work you can copy this url( <b>www.es.com/longh/?username=" + username +"</b>) and paste in your browser</i><br /> <br />Feel free to contact Private Hospitality on 111111xxxxxx22 / 8122 if you have any questions.<br /> <br />We are looking forward to seeing you,<br /> <br />Kind Regards,<br /> <br />Events Team<br /><b>Grosvenor House</b><br /> <br /></td></tr></table></td></tr></table></td></tr></table></body>";
vObCDOMsg.AutoGenerateTextBody =false;
vObCDOMsg.HTMLBody=body;
邮件发送完毕后,当收件人点击上面的链接时,网址会重新设计并显示如下:
<a href="http://zixvpm.infosecpartners.co.uk/?a=2541&m=&n=&s=a800000055267a&u=http%3a%2f%2fwww.eventsummary.com%2flongh%2f%3fusername%3dhtest33%26utm_source%3d%26utm_medium%3demail%26utm_campaign%3dunspecified&t=&e=subratkumar.parichha%40gmail.com&h=d6c5af2e" style="text-decoration:underline" target="_blank" data-saferedirecturl="***https://www.google.com/url?hl=en&q=http://zixvpm.infosecpartners.co.uk/?a%3D2541%26m%3D%26n%3D%26s%3Da800000055267a%26u%3Dhttp%253a%252f%252fwww.eventsummary.com%252flongh%252f%253fusername%253dhtest33%2526utm_source%253d%2526utm_medium%253demail%2526utm_campaign%253dunspecified%26t%3D%26e%3Dsubratkumar.parichha%2540gmail.com%26h%3Dd6c5af2e&source=gmail&ust=1463542862806000&usg=AFQjCNFk6t5OtTcmeIkJzpRDeSGlFTddSw"***>Please click here to Sign In.</a>
对于本节中的10个用户中的2个
dunspecified%26t%3D%26e%3DMadeleine.Montgomery%2540sonyatv.com%
有一些额外的字符被附加到链接,但它无法正常工作。 像这样的东西:
dunspecified%26t%3D%26e%3Mad%0d%0a%20%0d%0a%20eleine.Montgomery%40sonyatv.com%
有人可以分享一下这样做的想法吗?
答案 0 :(得分:0)
电子邮件中发送的最大推荐行长度有限制,如果超过这些限制,某些电子邮件客户端会添加空格和其他字符,我在通过ASP发送之前就已经在电子邮件中发生了这种情况。
尝试将长链接分成几行,每个空格都有一个换行符,所以在style =和target = etc之前,看看是否有帮助。
link ="<a href='long stuff here' " & vbCrLf _
& "style='some style' " & vbCrLf _
& "target='some target'> " & vbCrLf
而不是
link = "<a href='long stuff here' style='some style' target='some target'>"
拉尔夫