给位大侠,请帮忙看一下。objEmail.TextBody.Charset = "Gb2312" 错误,不能运行。要是没有这行,可以运行,但是中文是乱码。Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "DSN=cdma;uid=cdma_admin;pwd=cdma_admin"
objRecordset.CursorLocation = adUseClient
objRecordset.Open "SELECT * FROM RECEIVING_RELOG WHERE TO_CHAR(SENDMAILDATE,'YYYY') = TO_CHAR(SYSDATE,'YYYY') AND TO_CHAR(SENDMAILDATE,'MM') = TO_CHAR(SYSDATE,'MM') AND TO_CHAR(SENDMAILDATE,'DD') = TO_CHAR(SYSDATE,'DD')-2 AND ISSUE_DATE is null", objConnection, _
adOpenStatic, adLockOptimisticDo Until objRecordset.EOFtoid = ""If objRecordset("ReceiverID1")  <> "" then
toid =toid&objRecordset("ReceiverID1")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID2")  <> "" then
toid =toid&objRecordset("ReceiverID2")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID3")  <> "" then
toid =toid&objRecordset("ReceiverID3")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID4")  <> "" then
toid =toid&objRecordset("ReceiverID4")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID5")  <> "" then
toid =toid&objRecordset("ReceiverID5")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID6")  <> "" then
toid =toid&objRecordset("ReceiverID6")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID7")  <> "" then
toid =toid&objRecordset("ReceiverID7")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID8")  <> "" then
toid =toid&objRecordset("ReceiverID8")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID9")  <> "" then
toid =toid&objRecordset("ReceiverID9")&"@"&"freescale.com"&";"
End IfIf objRecordset("ReceiverID10")  <> "" then
toid =toid&objRecordset("ReceiverID10")&"@"&"freescale.com"&";"
End If SendEmailDate = Month(Now()) & "-" & Day(Now()) & "-" & Year(Now())
 
 
 Set objEmail = CreateObject("CDO.Message")
  objEmail.From = "[email protected]"
 objEmail.To = toid
 objEmail.Subject = "Delivery Notification on " & SendEmailDate
 objEmail.TextBody.Charset = "Gb2312"
 
 objEmail.TextBody = "Please pick up your goods within 24 hrs from receiving center. If you have any queries, please call our hotline number 13370329111 or Ext.85686516. Thanks." & vbCrLf & vbCrLf & "Delivery Date:" & objRecordset("REC_DATE") & vbCrLf & "Vendor Name:" & objRecordset("SUPPLIER_NAME") & vbCrLf & "PO#:" & objRecordset("PO_NO") & vbCrLf & "English Description:" & objRecordset("ENGLISH_DESC") & vbCrLf & "Chinese Description:" & objRecordset("CHINESE_DESC") & vbCrLf & "MAWB:" & objRecordset("MAWB") & vbCrLf & "HAWB:" & objRecordset("HAWB") & vbCrLf & "Original:" & objRecordset("ORIGIN") & vbCrLf & vbCrLf & "Best Regards," & vbCrLf & "Receiving Center"
 
  
  
 
 objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
 objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
 "remotesmtp.freescale.net"
 objEmail.Configuration.Fields.Item _
 ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
objRecordset.movenext
LoopobjRecordset.Close
objConnection.Close