Use of Batch File to Send Email

>> Friday, 8 June 2012

Use of Batch File to Send Email
Hi, I have recently come to know the different useful activities of the batch file. But, I want to know the technique from which I can send any type of email with the help of batch file. If anyone knows this, then please give me the code regarding it. I know that you can achieve this with the help of Outlook Express. But, I don't know how to achieve it with batch file.
Reply With Quote
#2
Old 26-12-2009
Jackson2's Avatar
Jackson2 Jackson2 is offline
Member

Join Date: Apr 2008
Posts: 2,265
Re: Use of Batch File to Send Email
I don't think that it is possible to send email with the help of batch file. As there would be need of initiating a SMTP connection in your operating system. And I think that only Professional or Server versions are able to do this. So, If you are using Windows xp operating system then it is not possible to achieve this. So, it is not possible to send email from your Windows xp operating system with the use of batch file.
Reply With Quote
#3
Old 26-12-2009
Techno01's Avatar
Techno01 Techno01 is offline
Member

Join Date: Apr 2008
Posts: 2,268
Re: Use of Batch File to Send Email
You need to use the following code in your batch file to send email with the help of it:
Code:

set EMAILFILE=%WD_TASKDIR%\..\System.Mail\Out\%WD_CONFIG%_%WD_CUREVT%.TMP
echo this is the subject > "%EMAILFILE%"
echo Techon^;t.does^ >> "%EMAILFILE%"
echo. >> "%EMAILFILE%"
echo ^ >> "%EMAILFILE%"
echo %WD_FILE_SHORTPATH% >> "%EMAILFILE%"
echo pecunia non olet >> "%EMAILFILE%"
echo Dear mam , >> "%EMAILFILE%"
echo Please find attached the file %WD_FILE_N% >> "%EMAILFILE%"
echo best regards, >> "%EMAILFILE%"
echo %COMPUTERNAME% >> "%EMAILFILE%"
rem okay, the script is created, now rename it so the wdPostMan program processes it.
ren "%EMAILFILE%" %WD_CONFIG%_%WD_CUREVT%.wdmail

Reply With Quote
#4
Old 26-12-2009
Trio's Avatar
Trio Trio is offline
Member

Join Date: May 2008
Posts: 2,752
Re: Use of Batch File to Send Email
You can able to create and execute small process with the help of batch files, but it is not possible to send email with the help of batch file. For sending email you need to have the web browser and then you need to fill the values in that and then only you will able to send that mail. But, if you use batch file for it then it would not able to communicate on internet. So, I don't think that you will able to send any email on internet with the use of batch file.
Reply With Quote
#5
Old 26-12-2009
deveritt's Avatar
deveritt deveritt is offline
Member

Join Date: Apr 2008
Posts: 2,528
Re: Use of Batch File to Send Email
You want to use the batch file for sending email which is not possible. As it is not possible to open Simple Mail Acess Protocol for the use of sending email from your batch file if you use lower versions of the Windows. It may be possible with the Professional version and Server version. But, I don't think that you will able to get any type of batch file sample to do this. As you will require knowledge of ports and protocol to create such type of batch file.
Reply With Quote
#6
Old 26-12-2009
johnson22's Avatar
johnson22 johnson22 is offline
Member

Join Date: May 2008
Posts: 2,111
Re: Use of Batch File to Send Email
If you want to send email from batch file then you need to have high quality of knowledge in networking and internet. But, you can make use of following command line e-mail programs to achieve same.

Blat
GBMailer
MailSend
GetMail

0 comments:

Post a Comment

Read - Share - Comment

About This Blog

Share and Save

About Author