[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Set outlook to send me a daily log file

Posted on 2011-04-24
9
Medium Priority
?
472 Views
Last Modified: 2012-05-11
I want to setup an automated email to my personal email address that is sent by Outlook from the server. I'm testing a robocopy job that generates a log file. I want outlook to send me the daily log file. i'd like to ad send mail commands to this cmd file so everything runs at once.

Here is the test robocopy batch file that creates a log named Robo-Today.txt

###
### Working copy with good file name  - mm/dd/yyyy
###
echo %date:~-4,4%
echo %date:~-7,2%
echo %date:~-10,2%
###
set yr=%date:~-4,4%
set mo=%date:~-7,2%
set dy=date:~-10,2%
set f2=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%
###
echo %f2%
set fn=robo-%f2%.txt
###
robocopy.exe f:\ x:\ *.txt /E /SEC /NP /COPYALL /Log:%fn%
copy %fn% Robo-Today.txt
 
0
Comment
Question by:Tony Giangreco
  • 4
  • 4
9 Comments
 
LVL 39

Accepted Solution

by:
Aaron Tomosky earned 1000 total points
ID: 35456895
Batch file emails are pretty rare. Usually people go vbscript or powershell. However here is one I found
http://www.robvanderwoude.com/email.php

Untested.
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35461601
You could also use the following free command line application to send your email.

http://www.interlog.com/~tcharron/blat194.zip

I added the required to your script. You must customize it to suit your needs.

Note that I did not review your suggested batch file.

Have fun,
Rene

@aarontomosky: I find your suggested link quite interesting.

 
@ECHO OFF

REM Working copy with good file name  - mm/dd/yyyy

echo %date:~-4,4%
echo %date:~-7,2%
echo %date:~-10,2%

set yr=%date:~-4,4%
set mo=%date:~-7,2%
set dy=date:~-10,2%
set f2=%date:~-10,2%-%date:~-7,2%-%date:~-4,4%

echo %f2%
set fn=robo-%f2%.txt

robocopy.exe f:\ x:\ *.txt /E /SEC /NP /COPYALL /Log:%fn%
copy %fn% Robo-Today.txt


:Email
REM SETTING UP EMAIL SETTINGS
	SET EmailTo=someone@somewhere.com
	SET EmailFrom=me@somewhereelse.com
	SET EmailSubject=A very important repot
	SET EmailBody=%fn%
	SET EmailServer=smtp.myispsmtpserver.com


C:\Tools\misc\blat.exe "%EmailBody%" -to "%EmailTo%" -f "%EmailFrom%" -s "%EmailSubject%" -server "%EmailServer%" -debug -timestamp -log "SendEmail.log" >NUL

Open in new window

0
 
LVL 25

Author Comment

by:Tony Giangreco
ID: 35463102
This is a good concept, but I need the email to be sent from outlook through Exhcange. We have a firewall rule in place that only allows outgoing mail from Exchange.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 25

Author Comment

by:Tony Giangreco
ID: 35483408
Ok, how can this be done with VB in an automated manner so it is sent out daily to me?
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35483635
0
 
LVL 25

Author Comment

by:Tony Giangreco
ID: 35483785
We have Outlook 2003 connected to exchange on the server, not using Outlook Express.
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35483855
Oups, my mistake. I'll look at it a bit later.

Cheers,
Rene
0
 
LVL 10

Assisted Solution

by:ReneGe
ReneGe earned 1000 total points
ID: 35483877
0
 
LVL 25

Author Comment

by:Tony Giangreco
ID: 35504485
Sorry for the delay, I haven't had a chance to try this, but I will look into it today.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

865 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