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

Posted on 2008-11-06
Medium Priority
Last Modified: 2012-05-05

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.

Question by:bsharath

Accepted Solution

mredfelix earned 1400 total points
ID: 22896645
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  = "test@test.com"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Body = "Hi"
objMailItem.Attachments.Add "file.xml"
Set objMailItem = nothing
Set objOutl = nothing

Open in new window

LVL 11

Author Comment

ID: 22896692
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


Assisted Solution

Chizl earned 600 total points
ID: 22900608
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.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question