[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 - Problem With Send To All

Problem With Send To All

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Problem With Send To All

Postby printbroker » Mon Sep 13, 2004 9:41 am

Lets start with this:
Options > Address Book > Add New > IT SAVES AND DISPLAYS THE HOLE PATH AS FOLLOWS - I have had this issue from your first release but never bothered with it until now!

C:\Program Files\PocoMail3\Address\MailingList it does not display like the normal book "Address" so when I run Send To All Script new or old version I get the following error which I believe is caused by the way the > Add New:

Here is the error when I try to use the Send All script:

An error has occured in Send To All $ErrorResult.File not found: "C:\PROGRA~1\POCOMA~1\Address\C:\Program Files\PocoMail3\Address\MailingList.ini

$ErrorLine: OpenBody $address $path

If I run the normal Address > it works fine.

I have unstalled PocoMail3, went through the register file and removed all Poco files, and re-installed it, and I still get the above error message
printbroker
New Arrival
 
Posts: 3
Joined: Mon Sep 13, 2004 9:21 am

Postby Hogyt » Mon Sep 13, 2004 12:38 pm

Hi,

I'm not sure why the names of the address books contains the full path when you create a new one. I tried it here and its okay unless i create the address book in a different folder to the default. To fix this, the code below checks for a colon in the address book name and assumes the name contains the full path if the colon is present, otherwise it appends the name to the address book folder as it did before:

Code: Select all
{### send_to_all_address_book

{ Script will send a prepared message to
{ all recipients listed in the chosen address book


{ Usage: use only manually, do not use on Incoming or Outgoing mail

{ Modifications:
{ 13Oct2003 - M.Motek
{           - Format delivery address to include display name from address book (if present)
{           - Allow common variable tag usage in the message.
{           - Display list of address books in setup screen.
{           - Add ImportSettings command.
{ 29Aug2004 - M.Bowen (Hogyt)
{           - Fixed problem with "Display As" setting in address book
{           - InputBoxes ask for info instead of setting it in Setup Script
{ 14Sep2004 - Modified to work with address books where name is full path

Set $OnErrorGoTo generalerror

    { Edit the following line to point to your text editor: }

External $userdata4 "Path to notepad.exe" "c:\\windows\\notepad.exe"
ImportSettings

    { Make sure file exists: }

FileExists &check $userdata4
If &check Then filefound
Set $message "Cannot find the text editor "
AddStrings $message $userdata4
MessageBox $message
Exit

:filefound
InputBox $userdata1 "Address book name to send mail to (don't enter file extension):%addressbooks%" "Test"
InputBox $userdata2 "Enter subject of the message:" "Announcement"
InputBox $userdata3 "What account would you like to send it from? %accounts%" "jdf"
Set $userfile1 $ScriptPath
AddStrings $userfile1 "sendallbody.txt"
Set $params \"
AddStrings $params $userfile1 \"
ExecuteAndWait $userdata4 $params
FileSize #n $userfile1
If #n ! 0 Then continue
MessageBox "No message body entered so sending mail has been cancelled"
Goto out

:continue

    { Read address book into the variable: }

Set $path $userdata1

If ":" ^ $userdata1 Then createdpath
Set $path $addresspath
AddStrings $path $userdata1

:createdpath
AddStrings $path ".ini"
OpenBody $addresses $path

    { Open the template to be sent: }

OpenBody $template $userfile1

    { Set the upper boundary for search through addresses: }

LineCount #count $addresses
Dec #count

    { Set initial value of the counter: }

set #i 0

    { Start the loop to collect all addresses into $ToSend: }

:Loop
GetLine $a #i $addresses

    { Single record: First, Last and Addresses are loaded into a multiline var: }

ReadCSV $entry $a
LineCount #lines $entry
If #lines < 3 then Next

    { Addresses (could be more than one) are loaded into a new multiline var: }

GetLine $name 1 $entry
GetLine $email 2 $entry
Set $to $email
If $name = "" Then Append
Set $to $name
AddStrings $to " <" $email ">"
:Append
AppendBody $ToSend $to
:Next
Inc #i
if #i > #Count then Leave
goto Loop

:Leave
LineCount #c2 $ToSend
Dec #c2

    { Set initial value of the counter: }

set #i 0

    { Setup the outgoing message: }

SetAccount $userdata3
CreateMessage %m
SetHeader %m "X-Account:" $userdata3
AppendToFile true
ReadEmail $e
SetHeader %m "From:" $e

    { Start the loop to send messages to all $ToSend addresses: }

:Loop2
GetLine $a1 #i $ToSend
AddTo %m $a1
Set $Body $Template
ReplaceCVT $Body %m False
AssignBody %m $Body
SetHeader %m "Subject:" $userdata2
SaveMessage %m "out.mbx"
ClearTo %m
Inc #i
if #i > #c2 then Out

goto Loop2

:Out
Exit

    { Error handler
:generalerror
  Set $message "An error has occurred in "
  AddStrings $message $PocoScriptName "\n$ErrorResult: " $ErrorResult "\n$ErrorLine: " $ErrorLine
  MessageBox $message
Exit


It may still not work so please post back one way or the other! Thanks :)
Mat
Hogyt
Poco Enthusiast
 
Posts: 241
Joined: Thu Jul 29, 2004 11:22 am
Location: England

Problem With Send To All

Postby printbroker » Tue Sep 14, 2004 2:18 am

Hello Hogyt. I copied and paste it and tested it, but it did not work when testing it inside the script, HOWEVER when I selected the script to run from the main menu it worked.

We need to see why it saves the hole path name. Poco needs to see if anyone else has the same problem.

Thank you for you quick reply
printbroker
New Arrival
 
Posts: 3
Joined: Mon Sep 13, 2004 9:21 am


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 3 guests

cron