1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with Batch Files ASAP...

Discussion in 'Windows & Other Software' started by .Kencs, 9 Apr 2010.

  1. .Kencs

    Mobster

    Joined: 14 Oct 2007

    Posts: 2,738

    I need help with a batch file asap please...

    For my job, I have to send emails to different 3rd party companies and each is different how it is layout out/worded.

    Instead of making a template and having to copy paste, I want to make a .bat file so when I run the .bat file, it will open up a new email, have the address already entered, the subject entered and the template entered into the email.

    I managed to get a .bat files to open up new emails to certain people with the address already in, but I dont know how to write the script for the subject title and body of message...

    Can someone help please?

    Thanks
     
  2. Memphis

    Capodecina

    Joined: 13 Jan 2004

    Posts: 12,204

    Location: Inverness

    Would mail merged e-mails not be easier?
     
  3. .Kencs

    Mobster

    Joined: 14 Oct 2007

    Posts: 2,738

    What do you mean?
     
  4. .Kencs

    Mobster

    Joined: 14 Oct 2007

    Posts: 2,738

    Anyone?
     
  5. Mp4

    Sgarrista

    Joined: 21 Apr 2006

    Posts: 8,475

    Location: Eastbourne

  6. mast3r

    Mobster

    Joined: 28 Jan 2007

    Posts: 2,550

    Location: Wilmslow, Cheshire

    Mail Merge would indeed be an Easier task but i dont think it will do exactly as the OP requests will it?
     
  7. marc2003

    Capodecina

    Joined: 6 Feb 2004

    Posts: 20,239

    Location: England

    are you using mailto: in your batch file? just add

    "mailto:[email protected]?subject=blah&body=blah blah"

    edit: use %0 for line breaks in the body
     
    Last edited: 12 Apr 2010
  8. .Kencs

    Mobster

    Joined: 14 Oct 2007

    Posts: 2,738

    I have the following:

    IF %SUP% == 1 start "" "mailto://******@*********.com?subject=NAME, FAULT, REF&body=

    Good Morning/Afternoon.

    Can I please log the following call.

    NAME
    ADDRESS
    ADDRESS
    ADDRESS
    POSTCODE

    FAULT

    Ref:

    Regards

    but when I save the .bat file it doesnt come out like the above, I get loads of symbols. How do I put the %0 in to make it appear how it is above...?

    Thanks
     
  9. aldo1234

    Associate

    Joined: 11 May 2009

    Posts: 65

    Can you use html code for the body then you could format the text as you like.

    Aldo
     
  10. .Kencs

    Mobster

    Joined: 14 Oct 2007

    Posts: 2,738

    :-S
     
  11. .Kencs

    Mobster

    Joined: 14 Oct 2007

    Posts: 2,738

    How do you mean put it into HTML code? Won't it be easier to have it in the .bat format as above? I just need to know where to place the %0 in the text to make it come out how i want it, like above.
     
  12. .Kencs

    Mobster

    Joined: 14 Oct 2007

    Posts: 2,738

    Can anyone offer some help? :)
     
  13. CaptainCrash

    Wise Guy

    Joined: 17 Sep 2008

    Posts: 1,716

    I can't make your script work properly using the mailto command (probably me being thick), but a bit of googling brought up this, which might be easier: SendEmail

    I've just tested something along these lines, and it works OK:

    Code:
    @echo off
    sendEmail -f [email][email protected][/email] -t ******@*********.com -s smtp.yourserver.com:587 -xu yoursmtplogin -xp yoursmtppassword -u "NAME, FAULT, REF" -o message-file=bodyofyouremail.txt
    Don't forget to use the right binary - one has TLS support, the other doesn't. :)