2016-05-17 165 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