2015-11-30 53 views
-1

我真的很困難的東西是非常基本的,需要一些幫助,因爲它不是從godaddy支持即將到來!不能發送電子郵件從godaddy smtp使用經典的ASP - 去生氣

出於某種原因,下面的代碼不發送任何電子郵件。

代碼似乎被執行的屬性,並用它調查了很多調試信息,但沒有幫助!

「來自」電子郵件地址是有效的,沒有問題!有任何想法嗎?港口?

歡呼聲中,周杰倫

<% 

Dim objNewMail 
Set objNewMail = Server.CreateObject("CDO.Message") 

objNewMail.From = "[email protected]" 
objNewMail.To = "[email protected]" 
objNewMail.Subject = "Interesting property sent by xxx" 
objNewMail.TextBody = "Click the following link to see the property :" '& vbcr & vbcr & "http://www.maltawide.eu/default.asp?pid=" 

' GoDaddy SMTP Settings 
'I had to remove the smpt settings as I dont have enough rep to post two links! 

Response.Write ("Message sent successfully!") 

%> 

回答

-1

我不知道爲什麼你的消息失敗了,但在這裏是從GoDaddy的託管工作郵件表單代碼。您只需構建表單頁以提交腳本中使用的表單字段,或更改腳本中的表單字段名稱以匹配現有表單,或者用字符串替換表單。示例的「創建代碼的消息部分」中包含了表單條目和分配的變量值的示例。

<% 
Dim strBody 
Dim strToAddress 
Dim strFromAddress 
Dim strReplyAddress 
Dim strBlindCC 

' Create the message 
strBody = Request.Form("Message") 
strToAddress = Request.Form("ToAddress") 
strFromAddress = Request.Form("FromAddress") 
strReplyAddress = "[email protected]" 
strBlindCC = "[email protected]" 



' Include the schemas 
sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing" 
smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver" 


' Set the mail server configuration 
Set objConfig=CreateObject("CDO.Configuration") 
objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort 
objConfig.Fields.Item(smtpUrl)="relay-hosting.secureserver.net" 
objConfig.Fields.Update 


' Send the message 
Set objMail=CreateObject("CDO.Message") 
Set objMail.Configuration=objConfig 

objMail.From=strFromAddress 
objMail.ReplyTo=strReplyAddress 

objMail.To=strToAddress 

objMail.BCC=strBlindCC 

objMail.Subject=strSubject 

objMail.HTMLBody = strBody 

objMail.Send 

%> 
+0

沒有快樂我害怕!我已經複製/粘貼了你的文字,並替換了變量,但沒有任何東西!確實很奇怪。 –

+0

你能複製你當前的代碼嗎?如果你這樣做,我會在我的GODaddy服務器上嘗試它,看看它爲什麼失敗。你得到什麼錯誤信息? – Charles

+0

謝謝查爾斯。不知道我可以複製當前代碼作爲評論,所以將編輯原始消息!我已經將問題縮小到兩個問題,一個是from地址(由於某些原因,信息(a)在godaddy上託管的maltawide.eu不起作用),另外兩個是試圖在msg主體中粘貼鏈接。見上面的代碼。 –