How to send an email using a windows batch file in XP

Posted on 2010-11-10
Last Modified: 2012-05-10
I am new to batch file and trying to do some things with it.  Can someone let me know how to send an email using Windows Batch File.  I am assuming that this can be done!

Many thanks
Question by:sweetiepie70
LVL 27

Accepted Solution

KenMcF earned 84 total points
ID: 34108059
When using batch files I like to use blat for sending emails.
LVL 53

Assisted Solution

by:Bill Prew
Bill Prew earned 83 total points
ID: 34108414
LVL 53

Expert Comment

by:Bill Prew
ID: 34108425
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.


Assisted Solution

escadavid earned 83 total points
ID: 34108992
Hi there

You can use a simple command line tool like CSSMTP

Here is an example to use it, in order to copy some files from a directory to another computer. Whole "REM" lines are comments.
REM  Put in the source directory
cd c:\backupdp
REM Trying to copy any files with *.bak extension
copy *.bak \\\F$\Backup
REM Validating if the copy was successfull then skip the ErrProc procedure
If %errorlevel%==0 Goto Success
REM If was not successfull then
cd C:\backupdp
REM Create a file called Error.log with a message
echo Backup of .bak files were NOT success > Error.log
REM This is the line to send the email to 2 addresses with a subject of "Copy Failed" and attaching the file Error.log
CSSMTP.exe -h192.168.10.37:25 -s"Copy Failed" -fC:\backupdp\Error.log
Goto End

cd C:\backupdp
Del *.bak
Del *.txt
echo Backup successfull> Backup.log

Echo End Process

Hope it helps.
LVL 53

Expert Comment

by:Bill Prew
ID: 34277385
On this one I think a number of viable answers to the question were posted, and should be recognized.  Perhaps just an equal split to all contributors.

LVL 69

Expert Comment

ID: 34277391
Sorry, but there are many questions posted like this, and the list of tools presented here does not add something new. Without the asker choosing any, and giving a reason why, I think retaining the question is useless.

Cleanup Volunteer
LVL 53

Expert Comment

by:Bill Prew
ID: 34277416
Okay, you moderators see the bigger picture better than I do, thanks for the feedback and your contributions to keep EE clean and robust.

LVL 95

Expert Comment

by:Lee W, MVP
ID: 34278267
> Sorry, but there are many questions posted like this, and the list of tools presented here does not add something new.
> Without the asker choosing any, and giving a reason why, I think retaining the question is useless.

I disagree.  This is the attitude I see on other sites, but EE has, since I can remember, never enforced preventing duplicate questions from different individuals.  If EE wants to, the time to do so is when the first question is asked, NOT when people have contributed their valuable time answering the questions.  Some of the experts who have provided information here may be trying to earn free memberships and it's not right to tell them you get nothing for this question because we have so many like it already, again, when this has not been done in the past.

I won't object again, but think this is an important point for every badger to remember and wanted to make sure it was seen.
LVL 53

Expert Comment

by:Bill Prew
ID: 34278564
Thanks for the support leew.


Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

778 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