We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Set outlook to send me a daily log file

Medium Priority
483 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
 
Comment
Watch Question

Director, SD-WAN Solutions
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
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

Author

Commented:
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.

Author

Commented:
Ok, how can this be done with VB in an automated manner so it is sent out daily to me?

Author

Commented:
We have Outlook 2003 connected to exchange on the server, not using Outlook Express.

Commented:
Oups, my mistake. I'll look at it a bit later.

Cheers,
Rene
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Sorry for the delay, I haven't had a chance to try this, but I will look into it today.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.