I'm new to scripting and I'm creating an automated task inside openoffice I'm having issue with the crude basic language but I found a excel macro written in vba that does what I need now im trying to convert this to a useable vbscript that can be executed from the command prompt with something like email.vbs mailto subject filetoattach
Dim cdoMsg As New CDO.Message
With cdoMsg
With .Configuration.Fields
.Item(cdoSendUsingMethod).Value = cdoSendUsingPort
.Item(cdoSMTPUseSSL).Value = True
.Item(cdoSMTPServerPort).Value = 465
.Item(cdoSMTPServer).Value = "smtpserver"
.Item(cdoSendUserName).Value = "[email protected]"
.Item(cdoSendPassword).Value = "mypass"
.Item(cdoSMTPAuthenticate).Value = cdoBasic
.Update
End With
.From = "myemail"
.To = "emailto"
.Subject = "Some more really spiffy mail for you!"
.TextBody = "please find attachment"
.AddAttachment App.Path & "attachment"
On Error Resume Next
.Send
End With
If Err.Number <> 0 Then
MsgBox "CDO error " & Hex$(Err.Number) & vbNewLine & Err.Description, _
vbOKOnly Or vbExclamation, _
Caption
Else
MsgBox "Mail sent!", vbOKOnly, Caption
End If