upgrade to send message text as well as attachment

This commit is contained in:
george 2011-05-16 18:53:26 +00:00
parent 16b6640184
commit d487ba4ccd
1 changed files with 41 additions and 5 deletions

View File

@ -74,8 +74,15 @@ TESTMAIL ;
;
TESTMAIL2 ;
; TEST OF MAILSEND TO gpl.mdc-crew.net
;S ZTO("glilly@glilly.net")=""
N C0CGM
S C0CGM(1)="This is a test message."
S C0CGM(2)="A Continuity of Care record is attached"
S C0CGM(3)="It contains no Protected Health Information (PHI)"
S C0CGM(4)="It is purely test data used for software development"
S C0CGM(5)="It does not represent information about any person living or dead"
S ZTO("glilly@glilly.net")=""
S ZTO("LILLY.GEORGE@mdc-crew.net")=""
;S ZTO("ncoal@live.com")=""
;S ZTO("martijn@djigzo.com")=""
;S ZTO("profmish@gmail.com")=""
;S ZTO("nanthracite@earthlink.net")=""
@ -85,7 +92,7 @@ TESTMAIL2 ;
. D CCRRPC^C0CCCR(.GPL,2) ; GET ONE FROM PATIENT 2
. M @ZATTACH=GPL ; PUT IT IN THERE FOR NEXT TIME
S ZSUBJECT="TEST OF THE NEW MAILSEND ROUTINE"
D MAILSEND(.GR,ZFROM,"ZTO",,ZSUBJECT,,ZATTACH)
D MAILSEND(.GR,ZFROM,"ZTO",,ZSUBJECT,"C0CGM",ZATTACH)
ZWR GR
Q
;
@ -107,22 +114,51 @@ MAILSEND(RTN,FROM,TO,CC,SUBJECT,MESSAGE,ATTACH,FLAGS) ; MAIL SENDING INTERFACE
S GM(2)="Content-Type: multipart/mixed; boudary=""1234567"""
S GM(3)=" "
S GM(4)=" "
S GM(5)="--1234567"
;S GM(5)="--123456788888"
;S GM(5)=$$REPEAT^XLFSTR("-",$L(X))
S GM(5)="--123456899999"
S GM(6)="Content-Type: text/xml; name=""ccr.xml"""
S GM(7)="Content-Transfer-Encoding: base64"
S GM(8)="Content-Disposition: attachment; filename=""ccr.xml"""
S GM(9)=" "
S GM(10)=" " ; FOR THE END
S GM(11)="--1234567--"
;S GM(11)="--123456788888--"
S GM(11)="--123456899999--"
S GM(12)=" "
S GM(13)=" "
S GG(1)="--123456899999"
S GG(2)="Content-Type: text/plain; charset=ISO-8859-1; format=flowed"
S GG(3)="Content-Transfer-Encoding: 7bit"
S GG(4)=" "
S GG(5)="This is a test message."
S GG(6)="A Continuity of Care record is attached"
S GG(7)="It contains no Protected Health Information (PHI)"
S GG(8)="It is purely test data used for software development"
S GG(9)="It does not represent information about any person living or dead"
S GG(10)=" "
S GG(11)="--123456899999--"
;S GG(11)="Content-Type: text/plain; charset=""us-ascii"""
S GG(12)=" "
;S GG(13)="This is a test message."
S GG(14)="A Continuity of Care record is attached"
S GG(15)="It contains no Protected Health Information (PHI)"
S GG(16)="It is purely test data used for software development"
S GG(17)="It does not represent information about any person living or dead"
S GG(18)=" "
S GG(19)="--123456899999"
S GG(20)="--987654321--"
K GBLD
;D QUEUE^C0CXPATH("GBLD","GGG",1,3) ; THE MESSAGE
;D QUEUE^C0CXPATH("GBLD","GG",1,10) ; THE MESSAGE
I $D(MESSAGE)'="" D ; THERE IS A MESSAGE
. D QUEUE^C0CXPATH("GBLD","GG",1,4) ; THE MIME BOUNDARY
. D QUEUE^C0CXPATH("GBLD",MESSAGE,1,$O(@MESSAGE@(""),-1)) ;THE MESSAGE
. D QUEUE^C0CXPATH("GBLD","GG",10,10) ;A BLANK LINE
D QUEUE^C0CXPATH("GBLD","GM",5,9)
I $D(ATTACH)'="" D ; IF WE HAVE AN ATTACHMENT
. D ENCODE("G2",ATTACH) ; ENCODE FOR SENDING
. D QUEUE^C0CXPATH("GBLD","G2",1,$O(G2(""),-1))
D QUEUE^C0CXPATH("GBLD","GM",10,12)
D QUEUE^C0CXPATH("GBLD","GM",11,12)
D BUILD^C0CXPATH("GBLD",GN)
;S GGG=$NA(^GPL("MIME2"))
K @GN@(0) ; KILL THE LINE COUNT