2012-06-22 4 views
1

현재 몇 달 안에 이전 서버가 중단되면 중단되지 않도록 이전 서버에서 많은 테스트 사이트를 업데이트하는 중입니다. 특히 한 사이트에 대한 문의 양식이 이미 손상되었습니다. 에 사용자가 클릭 자신의 정보를 기입 한 후 제출하면, 그들은이 오류되게됩니다 : 나는 SMTP는 이메일이 더 이상 전송하는 데 필요한하는 방식이 아니라고 들었다기존 ASP에서 연락처 양식의 SMTP 서버를 SMTP 서버로 변환

Server object error 'ASP 0177 : 800401f3' 

Server.CreateObject Failed 

/contactsubmit.asp, line 79 

800401f3 


Set Mailer = Server.CreateObject("SMTPsvg.Mailer") 
Mailer.FromName = "Web Visitor" 
If request("email") <> "" then 
    Mailer.replyto = request("email") 
Else 
    Mailer.replyto = "[email protected]" 
End If 
Mailer.FromAddress = "[email protected]" 
Mailer.RemoteHost = "hostserver" 
If TempTest = TRUE then 
Else 
    Mailer.AddRecipient siteOwner, ContactEmail 
    If ContactCC <> "" then 
    Mailer.AddCC siteOwner, ContactCC 
    End If 
End If 
If DesignerEmail <> "" then 
    Mailer.AddBCC DesignerEmail, DesignerEmail 
End If 
Mailer.Subject = siteOwner & " Contact Form" 
Mailer.ContentType = "text/html" 
Mailer.BodyText = strBody 
If Mailer.SendMail then 
    response.redirect "contact.asp?sent=yes" 
Else 
    response.redirect "contact.asp?sent=no" 
End If 

그래서 난에 모두 변화 시도 CDOSYS. 그러나 재미있는 점은이 서버에서 작동하는 동일한 SMTP 코드를 사용하여 테스트 한 사이트가 훨씬 더 많다는 것입니다. CDOSYS를 사용하여 변경 : 나는 운없이 Mailer.AddMailer.AddAddress로 변경 시도

Microsoft VBScript runtime error '800a01b6' 

Object doesn't support this property or method: 'Mailer.AddRecipient' 

/contactsubmit.asp, line 89 

:

Set Mailer = Server.CreateObject("CDO.Message") 
Mailer.From = "Web Visitor <[email protected]>" 
If request("email") <> "" then 
    Mailer.ReplyTo = request("email") 
Else 
    Mailer.ReplyTo = "[email protected]" 
End If 
Mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "hostserver" 
If TempTest = TRUE then 
Else 
    Mailer.AddRecipient siteOwner, ContactEmail 
    If ContactCC <> "" then 
    Mailer.Cc siteOwner, ContactCC 
    End If 
End If 
If DesignerEmail <> "" then 
    Mailer.Bcc DesignerEmail, DesignerEmail 
End If 
Mailer.Subject = siteOwner & " Contact Form" 
Mailer.HTMLBody = strBody 
If Mailer.Send then 
    response.redirect "contact.asp?sent=yes" 
Else 
    response.redirect "contact.asp?sent=no" 
End If 

그러나 지금 나는이 오류가 발생합니다. 아무도 내가이 오류를 해결하고 잘하면이 일을 얻을 수있는 방법을 알고 있습니까? 전에 메일 서버로 일한 적이 없기 때문에 사과해야합니다. 쉬운 수정이 아니지만 지난 3 시간 동안 검색 한 결과 .AddRecipient에 대한 좋은 대안이 생길 수는 없습니다.

답변

0

봅니다 아래 실행하기 그것에서 관련 필드를 가지고 스크립트 적용 후 CDO를 사용하여 메일을 보내는 간단한 방법 : 당신이받는 사람을 추가 할 수있는 방법을 볼 수 있듯이

Set myMail=CreateObject("CDO.Message") 
myMail.Subject="Sending email with CDO" 
myMail.From="[email protected]" 
myMail.To="[email protected]" 
myMail.TextBody="This is a message." 
myMail.Send 
set myMail=nothing 

은 다음과 같이이다 :

myMail.To="[email protected]" 

당신은 더 많은 예제이 도움이 here

희망을 볼 수 있습니다.

+0

그래서 내가 'ReplyTo'를 가지고 있다면 정확하게 '.To'여야합니다. – jlg

+0

'Reply.To'는 그대로 있지만'Mailer.AddRecipient'는'Mailer.To'가되어야합니다. – 03Usr

+0

도움을 주셔서 감사합니다 ! 우편 발송자는 지금 일하고있다 : D – jlg

1

CDO.Message 개체는 단순히 예를 들어 SMTP 전자 메일 주소의 표준 세미콜론으로 구분 된 목록을 지정하는 To, CcBcc의 문자열 속성했습니다
"Joe Bloggs" <[email protected]>; "Fred Smith" <[email protected]>