Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Batch file to send an attachment via email

Options
  • 27-11-2007 1:29pm
    #1
    Closed Accounts Posts: 419 ✭✭


    Hi,

    Could somebody give me some advise on how to create a batch file that will send an email to a user and attach a file to this email?

    I do not want to use a third party software like blat etc.

    Is there a simple way to do it?
    I have created the bit that opens an email message and inputs the subject and recipient but how do I make it attach a file and send the email?

    Thanks.


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Could you post the code of the batch file?


  • Closed Accounts Posts: 419 ✭✭Green Athene


    START mailto:x@abc.com?subject=Test%%20messageˆ&cc=w@abc.comˆ&body=Hi,%%0D%%0A%%0D%%0AThis%%20is%%20an%%20automatically%%20created%%20message.%%0D%%0A%%0D%%0ABye


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    I don't think you'll be able to add an attachment to an email using this method.

    You may be better off installing a scripting engine such as Perl or PHP on the machine and using that to script the process, since these contain libraries set up to handle email sending.

    I'm assuming you're looking to create this as a scheduled job, which makes a proper scripting engine all the better.


  • Closed Accounts Posts: 419 ✭✭Green Athene


    seamus wrote: »
    I don't think you'll be able to add an attachment to an email using this method.

    You may be better off installing a scripting engine such as Perl or PHP on the machine and using that to script the process, since these contain libraries set up to handle email sending.

    I'm assuming you're looking to create this as a scheduled job, which makes a proper scripting engine all the better.

    Hi Seamus,

    Thanks.
    Yes, that is exactly what I want to do. I need it to run every day to send me the content of a log file.


  • Closed Accounts Posts: 419 ✭✭Green Athene


    Any other ideas how I could create such a batch file?

    Thanks.


  • Advertisement
  • Registered Users Posts: 2,931 ✭✭✭Ginger


    You could use VBS quite easily to do this if you are working on a windows platform and using one of the MS Mail clients or CDO.


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes




Advertisement