KenyKeny
KenyKeny

Reputation: 151

Sending an one-message email to a receiver by batch script file(windows)

Actually i am writing batch file to validate a text file formats. "sending an email by using lotus note" is used for reporting to receiver that any format goes right or wrong. "Sending an email" is an action after reaching if-statements.

code for sending email: I am referencing to how can I add body to the mailto link from console Win?

       if %number% equ %count% (
       start "" "mailto:username in lotus note?subject=subject&body=body "

         )

I am almost there, the code above start lotus note and filled in the subject&body automatically.But it don't hit the "send" button,i have to write batch script for this send action,any suggestion

Upvotes: 1

Views: 850

Answers (1)

KenyKeny
KenyKeny

Reputation: 151

Oh, i got the answer by referencing to How to send an email from one Gmail account to another one using a batch file or script?.

First, download blat from http://www.blat.net/ on the left hand side, then you will get blat.exe after unzip some download packages. Then, blat.exe should be included in the same directory of your batch file. This sendmail action allow sender to use a fake email address and in the command i show you should put down your organization or company server name & port number(generally 25). Finally, an email can be sent by using code below:

blat.exe - -f [email protected] -to [email protected] -s Subject -body "type you body here" ^ -server hp2-server.abcd.abcdef:25
pause

some notification like "Sending stdin.txt to bla bla bla" will be shown on command windows once it succeeds.

Upvotes: 1

Related Questions