Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Apr 2001
    Location
    Glasgow, Lanarkshire, Scotland
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automating sending of mail (Outlook2k/Exchanhe5.5)

    Hi,

    Can anyone give me some pointers as to how we can automate the delivery of a file to an external party.

    The file is created at 5am, and comply to format salesddmmyyyy.csv

    Sometimes the creation time is delayed - but no more than 2 hours. So it would probably need to check to see when the file is created and execute then.

    Any help welcome!

    tia.

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automating sending of mail (Outlook2k/Exchanhe5.5)

    Can the process creating the file trigger another program - e.g. a batch file?
    If not, how important is it that it gets sent asap after creation? - i.e. could it be sent always at 7:00am?
    What operating system will this be running under?

  3. #3
    Lounger
    Join Date
    Apr 2001
    Location
    Glasgow, Lanarkshire, Scotland
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automating sending of mail (Outlook2k/Exchanhe5.5)

    Leif,

    Thanks for getting back so soon.

    Application is Cognos - can send keystrokes but it mucky.
    Could go at set time - but would prefer to go after it is created.
    Win98 is the O/S

    Hope this info helps.

    me.

  4. #4
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automating sending of mail (Outlook2k/Exchane5.5)

    OK - here is a cheap and cheerful method which should work. For simplicity, I suggest the generated files are created in one folder, then once sent moved to another. This saves on having to calculate the date, or know the actual name of the file.

    First thing, get yourself a copy of <A target="_blank" HREF=http://www.swsoft.co.uk/index.asp?page=freesoftware>smtpsend</A> from swsoft - <img src=/S/free.gif border=0 alt=free width=30 height=15>!
    Extract it and place smtpsend.exe in the Windows folder of the PC where the .csv file will be created.

    I have used the following variables - you will need to adjust to suit:

    c:csv = folder where created .csv files are written
    c:csvsent = folder where sent .csv files are moved to
    mailserver = machine name (or ip address) where your mailserver resides
    sender@mycompany.com = email address of the sender
    recipient@yourcompany.com = email address of recipient

    Next, using Notepad, create a file called mail.txt with the following contents (between the *** but excluding them) and save it in c:csv

    ***
    From: sender@mycompany.com
    To: recipient@yourcompany.com
    Subject: Daily csv report

    Daily csv report attached
    ***

    Then, using Notepad, create a file called SendCSV.bat with the following contents (between the *** but excluding them) and save it in c:csv

    ***
    @echo off
    for %%a in (c:csv*.csv) do smtpsend -a %%a mailserver sender@mycompany.com recipient@yourcompany.com c:csvmail.txt
    :end
    if exist c:csv*.csv move c:csv*.csv c:csvsent
    ***

    You can test the batch file by either opening a DOS window, move to the c:csv folder and typing sendcsv or from Start > Run and entering c:csvsendcsv.bat

    Then all you need to do is set up a schedule to run the batch file as often as you like between 5:00 and 7:00

    Let me know if anything is not clear - I've attached this entire message as a txt file in case it helps.

    (Note: this does not require Outlook to be either running or existing on the 'sending' PC)
    Attached Files Attached Files

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Automating sending of mail (Outlook2k/Exchanhe5.5)

    We have a little system in place that may be of some help. One of our systems creates a file to update an Access database, but like yours it is not always available when the program is trying to pull it. We have a batch file set up that checks for the file, and if it is not available a timer program runs instead. When the timer expires, the batch file is called again to recheck for the file. Once the desired file is found, everything continues processing as usual.

    If you think this might be suitable I'll check with the programmer who set it up and get you some specifics and what timer program he uses.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •