BLAT contents of file as subject line

Posted on 2006-04-28
Last Modified: 2008-02-26
I am looking for a way to blat the contents of a file as the subject line.  Currently the contents are appearing in the body using:

blat <filename> -to...

Question by:orionpm
    1 Comment
    LVL 30

    Accepted Solution

    This batch file will accept a file name and take the first line and use it as the subject. You'll want to change the -to part. Also, I just echo out the blat command. To enable it remove echo.

    @echo off

    if "%~1"=="" echo Please enter file name on the command line.&goto :EOF
    if not exist "%~1" echo %1 does not exist.&goto :EOF

    for /f "delims=" %%a in ('type "%~1" 2^>NUL') do set subject=%%a&goto STOP


    REM ** Remove echo and change to part
    echo blat "%~1" -subject "%subject%" -to

    Good Luck,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
    Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now