Is there a way to schedule a mail to be sent each day on a specific time with a file in the UNC path.


Is there a way to schedule a mail to be sent each day on a specific time with a file in the UNC path.
This file is daily changed . Is there any way to each day send a mail with this file as attachment to some users.

its a xlsm file which has to be mailed.

LVL 11
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try something in Vb script in the same UNC path
Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
'comment the next line if you do not want to see the outlook window
strEmailAddr  = ""
objMailItem.Recipients.Add strEmailAddr
objMailItem.Body = "Hi"
objMailItem.Attachments.Add "file.xml"
Set objMailItem = nothing
Set objOutl = nothing

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bsharathAuthor Commented:
I get this

I have the file name mentioned and have the vbs in the same folder where the file is
Windows Script Host
Script:      D:\Mail.vbs
Line:      9
Char:      1
Error:      Cannot find this file. Verify the path and file name are correct.
Code:      80070002
Source:       Microsoft Office Outlook

Line 9 has to have the full path of the file your attaching.   However I think it doesn't support UNC.   that being said, You have to map out the folder to a drive, which you can do in VBS as well before you run the above, then disconnect the drive before exiting.

However, this script does email, but you have to use (AT) command line to schedule it, or you can manually do it through Windows Scheduler.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.