Send mail using CDO & VBS from the command line or windows
using cscript.exe for command line and wscript.exe for windows.
Music by : I forgot to add any this time round ... fail. lol
but i didnt forget the code :
'on error resume next
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Mail sent via CDO & VBS"
objMessage.From = "email@email.com"
objMessage.To = "emailto@emailto.com"
objMessage.TextBody = "Easy command line email using CDO & VBS"
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
@jackoneill8 are you sure you have the correct server details??
hakology 6 months ago
Hello, love the video, love the idea, can't get it to work yet. When I run the command it says there is a error on the last line, first character. It says "The transport failed to connect to the server". That was after, of course, I found out it didn't work and told it to show me the errors. If I'm missing something obvious, sorry, I am kinda new to whole process. Thanks for any help!
jackoneill8 6 months ago