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

Hi,

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.

Regards
Sharath
LVL 11
bsharathAsked:
Who is Participating?

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

x
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.

mredfelixCommented:
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
objMailItem.Display
strEmailAddr  = "test@test.com"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Body = "Hi"
objMailItem.Attachments.Add "file.xml"
objMailItem.Send
Set objMailItem = nothing
Set objOutl = nothing

Open in new window

0

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

---------------------------
OK  
---------------------------
0
ChizlCommented:
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.    

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_23065351.html

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.
0
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.