ASP电子邮件脚本中断错误

时间:2015-02-14 22:22:11

标签: asp-classic

下面的电子邮件正文(messagebody)最近被发送为空白。我发现正在查询programmeremail而不是在messagebody上面的emailprogrammer。这可能导致消息体显示为空白吗?如果没有,还有什么可能导致这种情况吗?

''FINDS OUT WHO THE EMAIL IS TO.
            newStepTemp = newStep
            strSQL = " Select Description, orderid,emailMgmt, emailSE,emailSupport,programmeremail FROM RelDoc2 where stepid=" & newStepTemp
            set rs = objConnection.Execute(strSQL, ,adCmdText)
    addresses=""
    if(rs.fields("emailMgmt")) then
        addresses=addresses
    end if
    if(rs.fields("emailSE")) then
        addresses=addresses & ";" & adminemail
    end if
    if(rs.fields("emailSupport")) then
        addresses=addresses & ";" & setupemail
    end if
    if(rs.fields("emailProgrammer")) then
        addresses=addresses & ";" & programmeremail
    end if

    ''WHAT DOES THE MESSAGE SAY?
    messagebody = "<style type='text/css'>table.styled{font-family:Arial,Helvetica,sans-serif;font-size:13;}" &_
    "<table class='styled'>" &_
    "<tr><td><b>Relationship</b>: <a href='https://example.com/details.asp?relno="&relno&"'>" & aname & "-" & bname & "</a></td></tr>" &_
    "<tr><td><b>Document</b>: " & document & "</td></tr>" &_
    "<tr><td><b>New Status</b>: " & rs.fields("Description") & "</td></tr>" &_
    "<tr><td>&nbsp;</td></tr>" &_
    "<tr><td><b><u>Other Details</u></b></td></tr>" &_
    "<tr><td><b>Communication Method</b>: " & protocol & "</td></tr>" &_
    "<tr><td><b>Int Type</b>: " & intType & "</td></tr>" &_
    "<tr><td><b>Misc.</b>: " & additionalDetails & "</td></tr>" &_
    "<tr><td>&nbsp;</td></tr>" &_
    "</table>"


    ''EMAIL THE MESSAGE
    Set myMail=CreateObject("CDO.Message")
    myMail.Subject= "Update for " & aname & "-" & bname & " – " & document
    myMail.From=empemail
    myMail.To= addresses  
    myMail.HTMLBody= messagebody

1 个答案:

答案 0 :(得分:2)

试试这个:

''WHAT DOES THE MESSAGE SAY?
messagebody = "<html><head> <style type='text/css'>table.styled{font-family:Arial,Helvetica,sans-serif;font-size:13;} </style></head>" &_
"<body> <table class='styled'>" &_
"<tr><td><b>Relationship</b>: <a href='https://example.com/details.asp?relno="&relno&"'>" & aname & "-" & bname & "</a></td></tr>" &_
"<tr><td><b>Document</b>: " & document & "</td></tr>" &_
"<tr><td><b>New Status</b>: " & rs.fields("Description") & "</td></tr>" &_
"<tr><td>&nbsp;</td></tr>" &_
"<tr><td><b><u>Other Details</u></b></td></tr>" &_
"<tr><td><b>Communication Method</b>: " & protocol & "</td></tr>" &_
"<tr><td><b>Int Type</b>: " & intType & "</td></tr>" &_
"<tr><td><b>Misc.</b>: " & additionalDetails & "</td></tr>" &_
"<tr><td>&nbsp;</td></tr>" &_
"</table> </body></html>"

我希望能帮到你!