Can somebody please advise me on sending an email attachment using VBs. I've got the following code which I cant get to work. I think it might be that it needs a username and password inserting for it to send via the 1 and 1 SMTP server account. but I don't know where it needs inserting.
DIM fso
Set fso=CreateObject("Scripting.FilesystemObject")
On Error Resume Next
fso.CopyFile "D:\Backup docs1\Zip.zip"
'Wscript.Echo "File copy complete."
strSMTPFrom = "backups@XXXXXX.co.uk"
strSMTPTo = "i_MALC@XXXXXXX.co.uk"
strSMTPRelay = "auth.smtp.1and1.co.uk"
strTextBody = "Backup done vbs"
strSubject = "VBS Script"
strAddAttachment "D:\Backup docs1\Zip.zip"
Set oMessage = CreateObject("CDO.Message")
oMessage.Configuration.Fields.Item(" = 2
oMessage.Configuration.Fields.Item(" = strSMTPRelay
oMessage.Configuration.Fields.Item(" = 465
oMessage.Configuration.Fields.Update
oMessage.Subject = strSubject
oMessage.From = strSMTPFrom
oMessage.To = strSMTPTo
oMessage.TextBody = strTextBody
'oMessage.AddAttachment strADDAttachment
oMessage.Send
'Wscript.Echo "Email sent."
Const TIMEOUT = 10
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Popup "Email sent" , TIMEOUT
DIM fso
Set fso=CreateObject("Scripting.FilesystemObject")
On Error Resume Next
fso.CopyFile "D:\Backup docs1\Zip.zip"
'Wscript.Echo "File copy complete."
strSMTPFrom = "backups@XXXXXX.co.uk"
strSMTPTo = "i_MALC@XXXXXXX.co.uk"
strSMTPRelay = "auth.smtp.1and1.co.uk"
strTextBody = "Backup done vbs"
strSubject = "VBS Script"
strAddAttachment "D:\Backup docs1\Zip.zip"
Set oMessage = CreateObject("CDO.Message")
oMessage.Configuration.Fields.Item(" = 2
oMessage.Configuration.Fields.Item(" = strSMTPRelay
oMessage.Configuration.Fields.Item(" = 465
oMessage.Configuration.Fields.Update
oMessage.Subject = strSubject
oMessage.From = strSMTPFrom
oMessage.To = strSMTPTo
oMessage.TextBody = strTextBody
'oMessage.AddAttachment strADDAttachment
oMessage.Send
'Wscript.Echo "Email sent."
Const TIMEOUT = 10
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Popup "Email sent" , TIMEOUT