473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

CDO message - filename not appearing in message if run vbs from server

The script below is designed to send an email when file appears in a folder; the subject is set to the filename and the body includes the file path. If I run the script from my C drive, the email is fine; if I run it from a server the email has a blank subject and no filepath. Does anyone know why? Thank you
Expand|Select|Wrap|Line Numbers
  1. strRejectionsSourceFolder = "\\iseries\myfolder\"
  2. Set objFSO = CreateObject("Scripting.FileSystemObject")
  3. Set objShell = WScript.CreateObject("WScript.Shell")
  4. 'Cycle through any files in the source folder
  5. For Each sFile In objFSO.GetFolder(strRejectionsSourceFolder).Files
  6. 'Prepare an email to notify someone of the rejection
  7. Set myMail=CreateObject("CDO.Message")
  8. myMail.Subject=sFile.Name
  9. myMail.From=strRejectionsEmail
  10. myMail.To=strRejectionsEmail
  11. myMail.TextBody="A file has been rejected:" 
  12. myMail.TextBody= myMail.TextBody & vbcrlf & sfile.path
  13. ...set config fields and send...
  14. … move the file…
  15. Next  
  16.  
Dec 8 '15 #1
1 1170
Luk3r
300 256MB
If I understand correctly, you're running the script from a different server than the server that has the file/folder. Are you sure Server #2 has access to the folder on Server #1?
Dec 8 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John Doe | last post by:
I've never used a factory and would like to get some help. The class mailbox.UnixMailbox has a defination for a factory. __init__(self, fp, factory=<class rfc822.Message>) where fp is a file...
3
by: noah | last post by:
Is there a way to figure out what filename an email object points to in a qmail style Maildir directory? Hmmm... I don't think so, but I'm hoping I wrong. I instantiated a Maildir mailbox and...
1
by: Dalan | last post by:
Although I have used the code below to suppress the DoCmd cancel action message from appearing on lots of other actions such as preview and print, I have not been able to get to work on a...
2
by: Michelle | last post by:
Can anyone tell or point me to articles on how an asp application deals with messages returned from SQL Server?
1
by: Just D. | last post by:
All, What is the simplest way to send an email message through the MS SQL Server? There was a method to send email messages using a standard C# way via SMTP server, but the required port was...
5
by: sekarm | last post by:
Hi all, Happy to see you all again, I am going to develop one client server application using dotnet(vb.net or c#.net).The task is to develop two applications seperately. one application...
2
by: Jeff Kish | last post by:
Greetings. I am trying to add some debug to a stored procedure. I put some statements like this throughout the code: select 'some message here'; but I never see them. I put them in a...
8
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Now we have some trouble to directly access to SQL Server database. I would like to know if there is a special protocol in the communication between SQL SERVER client and databse system. What is...
1
by: ramyamuthusamy | last post by:
hi, I installed a new software called magic folders.. Also i reinstalled it few days back. After the reinstallation an error message occcurs that"windows cannot find magic.exe go to search and...
11
by: jon | last post by:
I'm trying to have a section where people can just start dragging files into a textbox and the full location of the file will be stored. MS-Dos has this function built into it, and it's written in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.