[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - How to attach with Send-to-all script

How to attach with Send-to-all script

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

How to attach with Send-to-all script

Postby ifanpayne » Tue Feb 22, 2005 7:35 am

Is it possible to send attachments using the Send-to-all script?

This is a really useful script for sending mail to everyone in an address book but there seems to be no way to include an attachment. I would love to be able to send attached pictures or documents to everyone in our reasearch project without them having to scroll past a long list of recipients.

Edit Eric: Moved to PocoScript.
ifanpayne
Drop-in Visitor
 
Posts: 7
Joined: Tue Feb 22, 2005 4:57 am

Postby Michael » Tue Feb 22, 2005 3:05 pm

There are probably several ways that this could be done. The simplest would be to add a prompt at the beginning of the script asking for the name of a file to be attached. If no file name were given then no file would be attached. The issue here though is that PocoScript does not have a file open dialog so you would have to type the full path and file name.

The most straightforward other method would be to convert the script to use a template. This would eliminate the need for the subject, account and body as all of these could be read from the template.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby ifanpayne » Wed Feb 23, 2005 12:33 am

Could explain a little of what you mean by converting the script to a template - or direct me to a resource or description please?
ifanpayne
Drop-in Visitor
 
Posts: 7
Joined: Tue Feb 22, 2005 4:57 am

Postby Michael » Wed Feb 23, 2005 2:16 am

What I am meaning by the reference to a template is to change the script so that it reads and proceses a template instead of reading the subject, body and account from the script setup tab. This does not change the script into a template but rather converts the script so that it can use a template.

To do this you would need to make the following changes:
  1. Change the external commands so the name of a template could be specified.
  2. Read the template file from disk
  3. Count the number of lines in the template
  4. Loop through each line in the template processing it and replacing any custom variable tags (use the ReplaceCVT command for this).

PS: I would make a copy of the script under another name before I started making any of these changes.

Note, I have attached files to messages using scripts but I have not done this with a template so there may be issues here I have not encountered.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron