Search Windows and Linux Networking

Thursday, April 14, 2011

Send Automated Emails Using SendEmail & Windows Task Scheduler

Send Automated Emails Using SendEmail & Windows Task Scheduler

         If you want automated mail be send after something has been done or you want after scheduled backup report in you Mailbox or want to command line method to send a email with or without attachment file. SendEmail is the very good utility for you and is open source. windows and Linux users can be use this utility to send mail from command line.you can also create batch file or VBScirpt and set a scheduled to run that batch file or script to send mail automatically what you want.

To use SendEmail you should know you smtp server address, port , and authentication detail.

I am going to use Gmail server detail to send mail 

Note:- I am using Sender (from) address fromaddress@gmail.com and for to address as toaddress@gmail.com both are not real . Only shown for demo purpose only. 

To known your mail server detail. Ask your system administrator or IT person ( If you having gmail account you can use same detail what i have been used or you can get it from your account setting forwarding and pop/IMAP setting and there configuration instruction.)

Outgoing server (SMTP ) for Gmail are :-

SMTP Server:- smtp.gmail.com (use authentication)
Use Authentication: Yes
Port for TLS/STARTTLS: 587

and suppose  my user name is fromaddress@gmail.com and password MyPass0rd then command look like this in single line.

 

SendEmail.exe -f fromaddress@gmail.com -t toaddress@gmail.com -cc ccaddress@yahoo.com -u "test mail from sendmail" -m "this is the test mail from batch file" -a "c:\report.xls"-s smtp.gmail.com:587 -xu fromaddress@gmail.com -xp MyPass0rd -o tls=yes

This will send mail "toaddress@gmail.com" with CC "ccaddress@yahoo.com" with subject "test mail from sendmail " contains "this is the test mail from batch file" and attach file from "c:\report.xls"

 If you want to do it automatically open the notepad type the command and save the file on same location where SendEmail.exe is store. and set schedule task

you can download SendEmail.exe for windows from following site.

http://caspian.dotconf.net/menu/Software/SendEmail/
  • f xxxxx@gmail.com : This parameter is the email address that will be the “sender.”
  • -t rdube@yahoo.com : This is the recipient’s email address.
  • -u Monday Status Updates : This is the subject
  • -m Here’s the analytics data for this week! : This is the message body.
  • -a Analytics_Channel1.csv Analytics_Channel2.csv Analytics_Channel3.csv : These are the attachments.
  • -s smtp.gmail.com:587 : SMTP server and port
  • -xu xxxxx@gmail.com : SMTP authentication ID name
  • -xp A1ienz2A51 : SMTP authentication password
  • -o tls=yes : SMTP uses TLS (or SSL)

3 comments:

  1. how can i check if there has been changes in the folder (like file uploaded via ftp client) and then send the email notification for it.

    ReplyDelete
  2. How can I send email to an address inside of a txt file?

    ReplyDelete