Sendmail is not working with exchange successfully since they have all the rule and relay server in place. I found vb script sample in this forum that will send email using outlook, which works good, but in the sample code, the attachment is hardcode in the function is there a way to make it into a variable. I have no knowledge on VB
objMsg.Attachments.Add "C:\daily_report.txt" ( this is in the sample and it works)
I wish I can do this
objMsg.Attachments.Add = (report)
let>report=C:\daily_report.txt
thank you for your input
attachment with vbscript
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: attachment with vbscript
Yes, in the same way you would any VBScript function, e.g. ..
Code: Select all
VBSTART
Sub SendEmail(to,from,bla,attachmentfile)
...
objMsg.Attachments.Add attachmentfile
...
bla bla
End sub
VBEnd
VBEval>SendEmail,blato,blafrom,bla,c:\some\file.txt
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: attachment with vbscript
works great !
thanks
thanks