我在嘗試使用經典ASP將附件添加到電子郵件時遇到問題。我已經瀏覽論壇,似乎我需要添加.AddAttachment =「c:\ users \ samplb \ logoblack.gif」,但表單不再工作。它出現了「網站無法顯示頁面」的消息。CDO.Message經典ASP - 添加附件
這裏是我的代碼:
<%
name = request.form("name")
Message = request.form("Message")
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "xxx"
.Update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "[email protected]"
.To = "[email protected]"
.Subject = "Feedback/Suggestions"
.AddAttachment = "c:\users\samplb\logoblack.gif"
.TextBody = "Name: " & name & vbcrlf & vbcrlf & "Message: " & Message
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
有誰知道爲什麼它可能無法正常工作?當我將.AddAttachment取出時,表單工作正常,但我真的需要它發送附件。
你是如何得到@Samp的[我的回答](http://stackoverflow.com/a/22784440/692942)的幫助? – Lankymart
嗨@Lankymart,我仍然無法得到它的工作。我確定你的回答是正確的,但我有限的知識阻礙了我。 – Samp
當您更新代碼時,您收到了什麼錯誤? – Lankymart