20101029 学习记录:asp发email并显示fromName/toName--Error code ‘8004020e’

做自动发邮件的代码一直没什么问题,只是这次要求加上FromName和ToName,稍微费了点力气

其实主要是格式的问题啦~ 果然还是应该加引号的,本来之前试过不加引号也能发出去的,可是今天不知怎么,咋也发送不成功了,错误代码‘8004020e’

于是网上好一顿大海捞针,说是应该以下面酱紫的格式....  = =|||

 

            objMessage.From = """" & FromName & """<" & FromMail & ">"  
            objMessage.To = """" & ToName& """<" & ToMail  & ">"
  //This would result in "Joe Bloggs"<joe@bloggs.com>
 

 

      dim  strEmailMessage
         
            
' Send email to the lead ***************************************        
            strEmailMessage  =   " <html><head></head><body><table border=0 cellpadding=0 cellspacing=0> "
            strEmailMessage  =  strEmailMessage  &   " <tr><td valign=top>Thank you for contacting us. We have received your request for returned merchandise, and your Return Merchandise Authorization code is <b> " &  xxxNumber  & " </b>.....</td></tr> "   
            strEmailMessage  =  strEmailMessage  &   " <tr><td>We will also email you a Refund Receipt as soon as we have received and processed your returned merchandise. However, if you have any questions about your refund, please feel free to reply to this email. Or you may call us at  "   &   mid (Phone, 1 , 3 ) & " - " & mid (Phone, 4 , 3 ) & " - " & mid (Phone, 7 , 4 &   "  from 5am to 5pm pacific time.</td></tr> "
            strEmailMessage  =  strEmailMessage  &   " <tr><xd valign=top>&nbsp;</td></tr> "
            strEmailMessage  =  strEmailMessage  &   " <tr><td>Sincerely, Customer Service&nbsp;</td></tr> "
            strEmailMessage  =  strEmailMessage  &   " <tr><td> "   &  ClientName  &   " </td></tr> "
            strEmailMessage  =  strEmailMessage  &   " </table></body></html> "
                 
     
set  objMessage  =   CreateObject ( " CDO.Message "
            
            objMessage.Configuration.Fields.Item ( " http://schemas.microsoft.com/cdo/configuration/sendusing " =   2   ' Send the message using the network (SMTP over the network).
            objMessage.Configuration.Fields.Item ( " http://schemas.microsoft.com/cdo/configuration/smtpserver " = " xxx.xxx.xxx.xxx "    ' ip
            objMessage.Configuration.Fields.Item ( " http://schemas.microsoft.com/cdo/configuration/smtpserverport " =   25  
            objMessage.Configuration.Fields.Item ( " http://schemas.microsoft.com/cdo/configuration/smtpusessl " =   False   ' Use SSL for the connection (True or False)
            objMessage.Configuration.Fields.Item ( " http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout " =   60
            objMessage.Configuration.Fields.Update
            
            objMessage.Subject  =   " Your Return Merchandise Authorization code  "  
            objMessage.From  = """" & FromName & """<" & FromMail & ">"   
            objMessage.To = """" & ToName& """<" & ToMail  & ">"
  
            objMessage.HTMLBody  =  strEmailMessage
     
            objMessage.Send
            
set  objMessage  =   nothing
    


http://bbs.blueidea.com/thread-2817482-1-1.html

http://newbeeshome.spaces.live.com/blog/cns!4B319CEEA4E3B052!267.entry 

http://forums.aspfree.com/asp-development-5/8004020e-error-137062.html

转载于:https://www.cnblogs.com/neru/archive/2010/10/29/1864479.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值