Results 1 to 7 of 7

Thread: email via batch file????

  1. #1
    Senior Member
    Join Date
    Jan 2004
    Posts
    172

    Question email via batch file????

    I am looking for a way to send an email via a batch files.
    I have a very critical service running on my windows 2000 machine/server and I need to know if it crashes. The only options i have are to restart the service or run a file/program (Restart the computer is definatly out). I figure run a batch file that sends me a email to my wireless phone saying the service has crashed. Problem is I don't know how to send such an email in DOS. I googled this and found some programs that will send the file however my company doesn't want to spend ANY money. We had a tornado hit our IT center and it cost us the rest of the budget to repair the servers and such.

    So I need a way to send an email via a dos batch file.

    HELP PLEASE...

    I have outlook 2000 loaded on this machine as well. but when I performed a switch on the outlook.exe software(outlook.exe /?) I got an error saying invalid switch.

    Does anyone know how to get this to work?

  2. #2
    the beign of authority kurt_der_koenig's Avatar
    Join Date
    Jan 2004
    Location
    Pa
    Posts
    567
    I don't think a batch file has what it takes, it might be a job for c++ or something along those lines but hey I''m not a ueberprogrammer. A program like the first one on this site might do for something in DOS batching http://www.georgiasoftworks.com/otherutilities.htm.

    I have outlook 2000 loaded on this machine as well. but when I performed a switch on the outlook.exe software(outlook.exe /?) I got an error saying invalid switch.
    yes that means it can't understand it. For example type 'notepad.exe /' it says can not open "/.txt file' and outlook is trying to open something it can't. Recheck your code again and see if you didn't type something not needed/typed to far...etc. Sorry I can't help you- i hope someone here can help you out.

  3. #3
    Damn i just a found a site whit **** load of batch files (texts, and actualy atch files.)

    lol: sorry i didnt include the link: http://www.bookcase.com/library/soft...til.batch.html

    btw: I don't know if you can make a batch file type something, but if you could wouldn't this be the batch file you needed to send an e-mail ?

    Code:
    @echo off
    telnet mail.yahoo.com 25
    helo
    MAIL FROM:you@hostname.com
    RCPT TO:them@someplace_else.com
    DATA
    Type in your message
    .
    QUIT
    O.G at A.O

  4. #4
    AO French Antique News Whore
    Join Date
    Aug 2001
    Posts
    2,126
    This don't work ©opy®ight, it's a illegal way to send a email and yahoo server will probably classified as spam.
    -Simon \"SDK\"

  5. #5
    I used yahoo just as an example: and i don't think it's illegal as long as you use correct and valid e-mail addresses....
    O.G at A.O

  6. #6
    Senior Member
    Join Date
    Jun 2004
    Posts
    460
    you can use e-mail via batch if you want and then have it send via a program named blat which sends smtp messages via command line:

    http://www.blat.net/

    however, the better way to do it would be via SNMP traps and have windows send SNMP messages to a client and then the client could page your cell phone or e-mail you or something like that... Windows has a SNMP service that you have to install, so all you have to do then is find a good client...

    here is a good description of what SNMP is if you don't already know:
    http://www.wtcs.org/snmp4tpc/snmp.htm

    IIRC windows also has a client, and then all you have to find is an event log manager that will notify you when a trap is received
    [gloworange]find / -name \"*your_base*\" -exec chown us:us {} \\;[/gloworange] [glowpurple]Trust No One[/glowpurple][shadow] Use Hardened Gentoo [/shadow]
    CATAPULTAM HABEO. NISI PECUNIAM OMNEM MIHI DABIS, AD CAPUT TUUM SAXUM IMMANE MITTAM

  7. #7
    Senior Member
    Join Date
    Jan 2004
    Posts
    172
    I found a way to do it via the command line. You need to install the most recent version of Windows Script Host and than create a .VBS file with the following:


    On Error Resume Next
    RCP = "Your Email Address"
    MSG = "Message Body"
    SUBJ = "Message Subject"

    Set Outlook = CreateObject("Outlook.Application")
    Set MAPI = Outlook.GetNameSpace("MAPI")
    Set NewMail = OUtlook.CreateItem(0)
    NewMail.Subject = SUBJ
    NewMail.Body = MSG
    NewMail.Recipients.Add RCP

    NewMail.Send

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •