VBA 코드를 사용하여 전자 메일을 보내려고합니다. 기능이 작동하고 전자 메일이 보내지지만 문제는 '런타임 오류 438 개체 이 속성 또는 메서드를 지원하지 않습니다 '여기VBA를 사용하여 전자 메일 보내기 '런타임 오류 438'
을 표시하는 코드입니다 :
Public Function SendEmail(ItemName As String, Total_Qnty As Integer)
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' send one copy with Google SMTP server (with autentication)
schema = "http://schemas.microsoft.com/cdo/configuration/"
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
Flds.Item(schema & "smtpserverport") = 465
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = "[email protected]"
Flds.Item(schema & "sendpassword") = "*****"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "[email protected]"
.From = "[email protected]"
.Subject = "Mail from gmail"
.HTMLBody = "The Stock Safty Level of Item: " & ItemName & " is DOWN, The total quantity you have is: " & Total_Qnty & "!!"
Set .Configuration = iConf
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Function
반가워요 어떤 아이디어가 .. 구성 요소 사이에 당신에게
오류 메시지가 표시되는 줄을 알려주십시오. –