I've been working on automating some notifications in our systems.  The
first was fairly easy and contained an attachment.  I ran into a problem but
figured out that I needed a (char(13)) at the end of the line.  Now, I'm
working on another that has two files attached.  I'm testing it with the
variables assigned to static files that are in the same directory.  Here are
the different results:

1) No attachments.  Priority and Format lines appear in the text of the
email.
2) No attachments.  Priority and Format are properly encoded.

When I set the attachment to only include one file, I get:

1) Attachment encoded.  Priority and Format lines properly encoded.
2) No attachment.  Priority and Format lines in the text of the message.
3) No attachment.  Priority and Format are properly encoded.

These results only vary after I delete the returns and spaces between lines
and add them back in.  There doesn't look like there is a change in the msg
file, though.

Can anyone explain the best way to look at the formatting of the msg file to
know the difference between the returns mention in the R:Mail help?

This is just aggravating.

Thanks,

Ben

The result of the message below was no attachments and the Priority and
Format lines were in the text of the email.

Here's the MSG file text:

-->
To: [EMAIL PROTECTED]
From: "ICT Merchant Services" <[EMAIL PROTECTED]>
Subject: ICT Collect-A-Check Payment Report
CC:
BCC:[EMAIL PROTECTED]
X-Attachments: CF010202.LOG,PD010202.DAT
Format:T
Priority: 2

Attention : Pauline

Good Morning, Pauline.

Attached are two files.
PDmmddyy.dat contains the actual payment data.
CFmmddyy.log contains the file stats.

Thanks,
ICT Merchant Services
 
<--


Here's the Resulting email:

-->
From: ICT Merchant Services [EMAIL PROTECTED]
Sent: Wednesday, February 09, 2005 1:40 PM
To: [EMAIL PROTECTED]
Subject: ICT Collect-A-Check Payment Report

Format:T
Priority: 2


Attention : Pauline


Good Morning, Pauline.

Attached are two files.
PDmmddyy.dat contains the actual payment data.
CFmmddyy.log contains the file stats.

Thanks,
ICT Merchant Services
<--


And the code that's generating the msg and sending the message:

-->
 set var CFFile text = 'CF010202.LOG'
 set var PDFile text = 'PD010202.DAT'
 set var vatstring text = (.cffile + ',' + .pdfile)

  SET VAR vreturn  TEXT = (CHAR(013))
  SET VAR v1        TEXT = ('Attention : Pauline')
  SET VAR vmailto   TEXT = ('To: [EMAIL PROTECTED]')
  SET VAR vfrom     TEXT = ('From: "ICT Merchant Services"
<[EMAIL PROTECTED]>')
  SET VAR vsubj     TEXT = ('Subject: ICT Collect-A-Check Payment Report')
  SET VAR vcc       TEXT = ('CC: ' + ' ')
  SET VAR vbcc      TEXT = ('BCC:' + '[EMAIL PROTECTED]')
  SET VAR vatline   TEXT = ('X-Attachments: ' + .vATstring + .vreturn)
  SET VAR vformat   TEXT = ('Format:T')
  SET VAR vpriority TEXT = ('Priority: 2')
  SET VAR vbody     text = ('Good Morning, Pauline.' + .vreturn + .vreturn
++
                            'Attached are two files.' + .vreturn ++
                            'PDmmddyy.dat contains the actual payment data.'
+.vreturn ++
                            'CFmmddyy.log contains the file stats.'
+.vreturn + .vreturn ++
                            'Thanks, ' + .vreturn ++
                            'ICT Merchant Services' + .vreturn)
  SET VAR vbody = (SRPL(.vbody,(CHAR(254)),.vreturn,0))

  DELETE mailtext.msg
  OUTPUT mailtext.msg
  WRITE .vmailto
  WRITE .vfrom
  WRITE .vsubj
  WRITE .vcc
  WRITE .vbcc
  WRITE .vatline
  WRITE .vformat
  WRITE .vpriority
  WRITE .vreturn
  WRITE .v1
  WRITE .vreturn
  WRITE .vbody
  OUTPUT SCREEN

  label retry-mail
  SET VAR vrmail = (UDF('@RMail.DLL','mailtext.msg'))

  IF vRMail not = 'S' THEN
    PAUSE 2 USING '<< ERROR SENDING EMAIL..>>' ICON STOP
    DIALOG 'Retry?' vresp vend Yes CAPTION 'Mail Delivery Failed.' ICON Warn
    if vresp = 'YES' then
    goto retry-mail
    endif
  ENDIF
<--

Reply via email to