Link to home
Start Free TrialLog in
Avatar of tsukraw
tsukraw

asked on

Multiple line output from command line in SMTP

I am not sure how to word this.
i am using a command line SMTP client to send a log file as a email. the utility is bmail.
http://www.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm

bmail -s localhost -t %%A -f backup@domain.local -h -a "Backup Report - %Date%" -b "Start time:%StartTime% End Time:%EndTime%" -m "%Logfile%"

The part:  -b "Start time:%StartTime% End Time:%EndTime%"
The output it is giving is Start time:16:27:18.77 End Time:16:28:03

I want it to be:
Start time:16:27:18.77
End Time:16:28:03

How do i get it to return to the next line between the 2 parts?
SOLUTION
Avatar of AmazingTech
AmazingTech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tsukraw
tsukraw

ASKER

-d is debug?
I think he means -m,

Steve
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry forgot to change the last time second time around:
set log="%temp%\logfile.txt"
echo Start time:%StartTime%>%log%
echo End Time:%EndTime%>>%log%
echo. >> %log%
type %logile% >%log%
bmail -s localhost -t %%A -f backup@domain.local -h -a "Backup Report - %Date%"  -m %Log%
I blame EE not accepting it first time around .... try changing

type %logile% >%log%


to
type %logfile% >>%log%

too!

Steve
I believe the piece that Tucker may not have shared is that the log file he is already attaching is generated out of a utility program, so that file needs to be attached, and can not be pre-pended to.  In addition to having that file attached, he wants a multiline body.

It doesn't look like bmail accepts multiple -m files so not sure how to solve this?

~bp
That is why I was (trying) to suggest creating the new text and then Appending the old file to the end and attaching that one instead.

Personally I tend to use blat.exe for mailing though have had to use bmail.exe for some people and can't think of another way at the moment short of using one of the MIME body encoding progs to make a body and attach it.

Steve
Gotcha Steve.

~bp
Avatar of tsukraw

ASKER

So overall the solution would be to have the script create a new log file with the content I want and join the utilities output log int it?  
outputting the content I want to a file is simple enough but how do I join the other file into it?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Didn't know this was a follow up Bill.  

See post 33616409 / 33616417 above :-)

Steve
Sorry, I was replying on my iPhone so the -d should have been the -m but also include the log file like how dragon-it explained it.
Accept billprew http:#33616905.
Assist dragon-it http:#33616409
and AmazingTech http:#33615393
Avatar of tsukraw

ASKER

Really no solution with this app.