ASP 电子邮件脚本因上面的错误而中断

ASP email script breaks from error above it

下面的电子邮件正文 (messagebody) 最近被发送为空白。我发现查询的是 programmeremail 而不是 messagebody 上面的 emailprogrammer。这可能会导致 messagebody 显示为空白吗?如果不是,是否还有其他可能导致此问题的原因?

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

试试这个:

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

希望对你有帮助!