2012-09-19 73 views
0

我有以下CDONTS代碼工作正常:CDONTS在循環問題2008服務器

Dim CDONTSMail 
Set CDONTSMail = CreateObject("CDONTS.NewMail") 
CDONTSMail.From= "[email protected]" 
CDONTSMail.To= "[email protected]" 
CDONTSMail.Subject= "500.100 Error: " & objASPError.File 
strBody = "This is a test message." & vbCrLf 
CDONTSMail.Body= sErrorMes 
CDONTSMail.Send 
set CDONTSMail=nothing 

然而,在一個循環中出現了錯誤使用時,以下?有任何想法嗎?

'Create Mailer object and send message 

CDONTSMail.From= "[email protected]" 
CDONTSMail.To = Session("Email") 
CDONTSMail.Subject = Subject 
strBody = MainMessage & vbCrLf 
CDONTSMail.Body= strBody 
CDONTSMail.Send 

回答

1

您需要重新設置CDONTSMail。

在循環試試這個:

Set CDONTSMail = CreateObject("CDONTS.NewMail") 
CDONTSMail.From= "[email protected]" 
CDONTSMail.To= "[email protected]" 
CDONTSMail.Subject = Subject 
strBody = MainMessage & vbCrLf 
CDONTSMail.Body= strBody 
CDONTSMail.Send 
set CDONTSMail=nothing