2016-05-17 163 views
2

发送邮件我正试图发送一个邮件在特定事件上的传统的ASP应用程序,这是怎样的代码有云:地址问题而在传统的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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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 />&nbsp;<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 />&nbsp;<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 />&nbsp;<br />Please ensure that you complete your pre-order by <font color='#000000'>" + deadline + "</font>.<br />&nbsp;<br /><a href='http://www.es.com/longh/?username=" + username + "' style='text-decoration: underline;'>Please click here to Sign In.</a><br />&nbsp;<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 />&nbsp;<br />Feel free to contact Private Hospitality on 111111xxxxxx22/8122 if you have any questions.<br />&nbsp;<br />We are looking forward to seeing you,<br />&nbsp;<br />Kind Regards,<br />&nbsp;<br />Events Team<br /><b>Grosvenor House</b><br />&nbsp;<br /></td></tr></table></td></tr></table></td></tr></table></body>"; 
vObCDOMsg.AutoGenerateTextBody =false; 
       vObCDOMsg.HTMLBody=body; 

邮件越来越发送后,当接收器点击上面的链接中的URL得到重新设计,未来这样的事情:

<a href="http://zixvpm.infosecpartners.co.uk/?a=2541&amp;m=&amp;n=&amp;s=a800000055267a&amp;u=http%3a%2f%2fwww.eventsummary.com%2flongh%2f%3fusername%3dhtest33%26utm_source%3d%26utm_medium%3demail%26utm_campaign%3dunspecified&amp;t=&amp;e=subratkumar.parichha%40gmail.com&amp;h=d6c5af2e" style="text-decoration:underline" target="_blank" data-saferedirecturl="***https://www.google.com/url?hl=en&amp;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&amp;source=gmail&amp;ust=1463542862806000&amp;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% 

这里是有问题的URL: http://zixvpm.infosecpartners.co.uk/?a=2541&m=&n=&s=a400000019ae8f&u=http%3a%2f%2fwww.es.com%2flongh%2f%3fusername%3dontgomery42%26utm_source%3d%26utm_medium%3demail%26utm_campaign%3dunspecified&t=&e=Mad%0d%0a%20%0d%0a%20eleine.Montgomery%40sonyatv.com&h=b886b5d2

http://zixvpm.infosecpartners.co.uk/?a=2541&m=&n=&s=ba00000134a7c3&u=http%3a%2f%2fwww.es.com%2flongh%2f%3fusername%3deters82%26utm_source%3d%26utm_medium%3demail%26utm_campaign%3dunspecified&t=&e=karolin.peters%254!0nkf.ch&h=949d75bf

http://zixvpm.infosecpartners.co.uk/?a=2541&m=&n=&s=a60000000bf20e&u=http%3a%2f%2fwww.es.com%2flongh%2f%3fusername%3dargue32%26utm_source%3d%26utm_medium%3demail%26utm_campaign%3dunspecified&t=&e=vicki.dargue%40pla!cesforpeople.co.uk&h=8b1c26e4

能有人分享如何这一些想法的行为就像这样?

+2

我们可以看到如何'生成body'的代码?问题是否仅在特定的电子邮件客户端中发生?如果您可以为10个用户中的2个提供确切的问题URL,而不仅仅是这样,可能会有所帮助。 – johna

+0

你把'Server.UrlEncode()'链接添加到'HTMLBody'之前? – Lankymart

+0

也是这是一个错字? - '
A HREF =''的'标记不正确形成缺少'<'支架。 – Lankymart

回答

0

上都安有电子邮件发送最大推荐线路长度的限制,如果你去了这些限制一些电子邮件客户端添加空格和其他字符,我有这种情况发生在通过电子邮件发送ASP时之前。

尝试拆分长链接到几行,用一个换行符在每个空间,所以风格=和目标=等之前,看看有没有什么帮助。

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'>" 

拉尔夫

+0

不确定这是在发送邮件到SMTP服务器时处理'href'的问题,看起来是某种安全产品/'代理/防火墙问题。 – Lankymart

+0

啊,我认为当电子邮件中的**被查看时,它只是不正确的。道歉。 – Ralpharama