[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 - Scripting bug?

Scripting bug?

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Scripting bug?

Postby watusimoto » Thu Oct 21, 2004 10:13 am

I wrote the following script to create two messages, one with an attachment and one without. Unfortunately, the same attachment is added to both. Is this a bug? Is there a known work around?

Here is the code:

Code: Select all
set $ud_Account "My Account"
set $ud_To "chris@xxxxx.com"

setAccount $ud_Account
readEmail $addr

{ Create first message, with attachment

createMessage %newMessage
addTo %newMessage $ud_To

addHeader %newMessage From $addr
addHeader %newMessage Subject ::PocoSync::
assignBody %newMessage "Body 1"

attachFile %newmessage "C:\Audit.log"

SaveMessage %newmessage Draft.mbx


{ Create a second, with no attachment


createMessage %newMessage
addTo %newMessage $ud_To

addHeader %newMessage From $addr
addHeader %newMessage Subject ::PocoSync::
assignBody %newMessage "Body 2"

SaveMessage %newmessage Draft.mbx




Note that this will be part of a loop, so I need to reuse the variable %newMessage.

Thanks,

Chris

[Edit by Robin: for clarity I have added the Code box]
watusimoto
Drop-in Visitor
 
Posts: 14
Joined: Wed Oct 06, 2004 4:49 am

Postby Michael » Thu Oct 21, 2004 12:22 pm

I'm think this is a bug. Based on your observations it would seem that the message variable isn't being completed reset by the CreateMessage command. My suggestion for the interim is to use the DeleteAttachment command after saving the message.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby watusimoto » Fri Oct 22, 2004 5:42 am

Upon closer observation, I find the same problem with the To header... it tends to retain addresses from the last time.

I have found a work around by manually deleting any previous attachments from the new message, and manually clearing the To field after creating a message. That works for me because I know what those previous attachments were, but it may not work in all cases.

Chris
watusimoto
Drop-in Visitor
 
Posts: 14
Joined: Wed Oct 06, 2004 4:49 am


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron