Pages: 1
RSS
Generating and emailing text files, Trying to script an email with attachments and mail it
 
Currently I am using Eudora to download emails from an account.  The only thing that is really relevant in these emails is the attachments.  The great thing that Eudora does is it automatically strips the attachments and puts them into a local directory.

The amazing thing that The Bat! can do (that I have not found in any other email application) is that I can specify what directory the attachments can be placed in via a filter.

What I also need to do is to send out emails (with attachments).  Currently, I can do this via a perl script that creates a text file, and then calls Eudora (which is already running) to create the email, and send it.

Currently, my perl script creates a text file named "email.msg" that contains the following text:

Code
To: target_email@gmail.com 
Subject: Subject Text goes here 
X-Attachments: C:\Path\to\file\attachment.jpg 
All of the text goes here.


It then calls Eudora, and gives it that file on the command line.  Eudora picks it up and mails it.

I am trying to do this with The Bat!, and it seems possible, but I am having trouble with the file format.  It seems to put everything To, Subject, Attachments) into the body of the email, but doesnt give it a recipient or actually attach the files.  

What is the proper file format/command line syntax to get this to work?

Thanks!
 
I have a quick template that does this. There is an entire email body followed by:

%TO="name@domain.com"
%SUBJECT="Latest Updates %DATEEN"
%ACCOUNT="Google Account"
%ATTACHFILE="C:\Program Files\file\file.zip"



 
Call the file that you create email.tpl (I prefer the .tpl extension to show that it's a template and not a text file or a message) and store it as plain text.

And in that template you can use every macro that you can use in any template in TB. You can limit that to Rick's example, but you can also write a complete message.

Now start TB with the commandline parameter /mail, would turn out as something like this:
"C\Program Files\The Bat!\thebat.exe" MailT=C:\Temp\example.tpl

The help file explains this. Look for 'advanced use - command line parameters - /MAIL'
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
Pages: 1