C55 Messaging 
Author Message
 C55 Messaging

I have written a program using C55 messaging templates to automatically send
out emails with text files (*.txt) attachments. Everything went fine and I
have been using it for about 4 months.
Problems came when I modified the program to allow attachment of Word
Document files instead of just text files.
The program became unstable. I may be able to send out more than 100 emails
without any problems but it may just "hang" after sending a few emails.
I am suspecting that I am using the wrong parameters for the
"message.addattachment " function and I could not find any documentations on
this subject.
I am using :
Message.AddAttachment('C:\c55\AUTOMAIL\0AU01IN20010823115056.DOC','',Content
:Application,SubType:plain, Base64.IEncoder, )
And I have also tried
Message.AddAttachment('C\c55\AUTOMAIL\0AU01IN20010823115056.DOC','',Content:
Application,SubType:msword, Base64.IEncoder, )
Can anyone tell me what are the correct parameters for use with Word
document file.
I am using C55Ee.
Thanks for any help

Kong



Wed, 11 Feb 2004 18:59:50 GMT  
 C55 Messaging
Hi,

I'm having a similar problem.  I'm trying to send an EXE and don't know the
parameters to use.  I tried looking this up in the documentation, but the
only thing I found is help text telling me to look in the Application
Handbook.  The problem is there is no more Application Handbook (or at least
it's not one of the PDF's I received.)

Thanks for any help,

Abe

Quote:
> I have written a program using C55 messaging templates to automatically
send
> out emails with text files (*.txt) attachments. Everything went fine and I
> have been using it for about 4 months.
> Problems came when I modified the program to allow attachment of Word
> Document files instead of just text files.
> The program became unstable. I may be able to send out more than 100
emails
> without any problems but it may just "hang" after sending a few emails.
> I am suspecting that I am using the wrong parameters for the
> "message.addattachment " function and I could not find any documentations
on
> this subject.
> I am using :

Message.AddAttachment('C:\c55\AUTOMAIL\0AU01IN20010823115056.DOC','',Content
Quote:
> :Application,SubType:plain, Base64.IEncoder, )
> And I have also tried

Message.AddAttachment('C\c55\AUTOMAIL\0AU01IN20010823115056.DOC','',Content:
Quote:
> Application,SubType:msword, Base64.IEncoder, )
> Can anyone tell me what are the correct parameters for use with Word
> document file.
> I am using C55Ee.
> Thanks for any help

> Kong



Thu, 12 Feb 2004 05:58:09 GMT  
 C55 Messaging
Hi

I have just coded what I thought was a simple procedure to send files from a
directory as attachments to all the email addresses in a file.  I followed
the hand coded example that came with Clarion 5.5.  Everytime I press the
send button, I get a windows error and my program closes down.  I've spent
all afternoon trying to figure out what's wrong, and I can't get it.  I
would appreciate it if someone would take a look at the following code, and
offer some suggestions.  The problem is in the SendTheMessage Routine, I
included the rest of the code so that you can follow what I'm doing.  The
procedure loads ups a queue with all the *.EXE files in a directory.  These
are self extracting EXE's that contain JPEG images.  It loads up another
queue with all the names and email addresses of the recipients. Then it's
supposed to send a single message with all the attachments to all the
recipients.

The error message is -  'Program has caused errors and will be closed by
windows.  You will need to re-start program'

Thanks in advance for your help.

Abe

SendEmail            PROCEDURE

SmMessage       MessageClass
Subject         String(100)
MessageText     String(1000)
FilesQ          Queue(File:Queue),Pre(Dir)
                End

RecipientQ      Queue,Pre(Rcp)
Rcp:Name                        Like(REC:Name)
Rcp:EMail                       Like(REC:Email)
                End

AttachListQ     Queue,Pre(Ath)
Ath:Name                        String(50)
Ath:ShortName                   Like(Dir:Name)
                End

Recs            UShort
AtRec           UShort
FolderName      String(50)
FileSpec        String(20)
W    WINDOW('Send E-Mail'),AT(,,189,311),FONT('MS Sans
Serif',8,,),IMM,HLP('SendEmails'),SYSTEM,GRAY, |
         DOUBLE,MDI

LIST,AT(4,4,181,41),USE(?Recipient),IMM,SKIP,NOBAR,VSCROLL,FORMAT('80L|M~Rec

       GROUP('Subject'),AT(4,49,181,22),USE(?Group3),BOXED
       END

       GROUP('Attachments'),AT(4,72,184,148),USE(?Group1),BOXED

LIST,AT(9,83,173,132),USE(?AttachList),IMM,SKIP,NOBAR,VSCROLL,FORMAT('101L(2

             FROM(AttachListQ)
       END
       GROUP('Message Text'),AT(7,222,179,62),USE(?Group2),BOXED
         TEXT,AT(12,233,173,47),USE(MessageText)
       END

BUTTON('Close'),AT(30,289,63,22),USE(?CloseButton),RIGHT,ICON(ICON:Hand)
       BUTTON('Send'),AT(94,289,64,22),USE(?SendButton),LEFT,ICON(ICON:Tick)
     END

  CODE

 FolderName = 'C:\Olem\Pics\Zip\'
 FileSpec   = '*.EXE'
 Subject    = 'OSSIT Updates Attached'
 MessageText= 'Please run the attached programs to update the OSSIT image
files.'
 Do LoadRec
 Do LoadAttach
 Open(W)
     ACCEPT
      Display
      CASE FIELD()
       OF ?SendButton
          CASE EVENT()
          OF EVENT:Accepted
             SetCursor(CURSOR:Wait)
             Do SendTheMessage                            !
<----------------------------------------This is where the problem is
             SetCursor()
             BREAK
          End
       OF ?CloseButton
          CASE EVENT()
          OF EVENT:Accepted
             BREAK
          End
       END
    END
LoadRec    Routine
  Relate:Recepients.Open()
  STREAM(Recepients)
  Set(Recepients)
  Next(Recepients)
  Loop Until EOF(Recepients)
   If REC:Active = True
    Rcp:Name  = REC:Name
    Rcp:EMail = REC:Email
    Add(RecipientQ)
   End
   Next(Recepients)
  End
  FLUSH(Recepients)
  Relate:Recepients.Close
LoadAttach Routine
    Free(AttachListQ)
    Directory(FilesQ,Clip(FolderName) & Clip(FileSpec),ff_:Directory)
    Recs = Records(FilesQ)
    Loop AtRec = 1 to Recs by 1
        Get(FilesQ,AtRec)
        If ~(Dir:Name = 'AllImageFiles.EXE')
           Ath:Name = Clip(FolderName) & Dir:Name
           Ath:ShortName = Dir:Name
           Add(AttachListQ)
        End
    End
    Free(FilesQ)
SendTheMessage Routine
       SmMessage.SetDefaultSMTPServer(SMTPServer)
       SmMessage.SMTP.DefaultPort = SMTPPort
       SmMessage.SMTP.Sender = SenderHeader
       SmMessage.SMTP.From = SenderName
       SmMessage.SMTP.SenderDomain = SenderDomain
       SmMessage.SMTP.SetHeader('X-Priority','1 (Highest)')
       SmMessage.Description = Subject
       Do AddRec
       SmMessage.AddBody(MessageText)
       Do AddAtt
       If SmMessage.Send()
        SilentErrors.ViewHistory()
       End
       SmMessage.FreeAttachments()
       SmMessage.Kill()
AddRec     Routine
       Recs = Records(RecipientQ)
       Loop AtRec = 1 to Recs by 1
            Get(RecipientQ,AtRec)

SmMessage.AddRecipient(Clip(RCP:Email),Clip(RCP:Name),SendTo,SMTP,)
       End
AddAtt     Routine
       Recs = Records(AttachListQ)
       Loop AtRec = 1 to Recs by 1
            Get(AttachListQ,AtRec)

SmMessage.AddAttachment(Clip(ATH:Name),Clip(ATH:ShortName),Content:Applicati
on,Subtype:octetstream,Base64.IEncoder, )
       End



Thu, 12 Feb 2004 09:39:59 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. C55 messaging tpl - how authenticate

2. Help C55 Mail Messaging Templates

3. Messaging Templates in C55 gold

4. Error after upgrade from C55 (D) to C55 (H)

5. Replace standard MESSAGE function in C4 with own message function

6. How to mapp clarion message to my message procedure

7. output color message (text) to a message box (string)

8. output color message (text) to a message box (string)

9. How to retrive forwarded message from multipart message body

10. C55 RARS up on website! But read the message!

11. Please Help - can't load C55

12. Windows NT and C55 beta 2 app

 

 
Powered by phpBB® Forum Software