Changeset 1204 for ccr/trunk/p/C0CMIME.m
- Timestamp:
- Jun 23, 2011, 3:01:41 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CMIME.m
r1191 r1204 1 C0CMIME ; CCDCCR/GPL - MIME manipulation utilities; 3/8/11 1 C0CMIME ; CCDCCR/GPL - MIME manipulation utilities; 3/8/11 ; 5/16/11 2:32pm 2 2 ;;1.0;C0C;;Mar 8, 2011; 3 3 ;Copyright 2008 George Lilly. Licensed under the terms of the GNU … … 81 81 S C0CGM(4)="It is purely test data used for software development" 82 82 S C0CGM(5)="It does not represent information about any person living or dead" 83 S ZTO("glilly@glilly.net")="" 84 S ZTO("LILLY.GEORGE@mdc-crew.net")="" 83 ;S ZTO("glilly@glilly.net")="" 84 ;S ZTO("george.lilly@pobox.com")="" 85 ;S ZTO("george@nhin.openforum.opensourcevista.net")="" 86 ;S ZTO("mish@nhin.openforum.opensourcevista.net")="" 87 S ZTO("brooks.richard@securemail.opensourcevista.net")="" 88 ;S ZTO("LILLY.GEORGE@mdc-crew.net")="" 85 89 ;S ZTO("ncoal@live.com")="" 86 90 ;S ZTO("martijn@djigzo.com")="" 87 91 ;S ZTO("profmish@gmail.com")="" 88 92 ;S ZTO("nanthracite@earthlink.net")="" 89 S ZFROM="ANTHRACITE.NANCY" 93 S ZTO("gpl.doctortest@gmail.com")="" 94 S ZFROM="LILLY.GEORGE" 90 95 S ZATTACH=$NA(^GPL("CCR")) 91 96 I $G(@ZATTACH@(1))="" D ; NO CCR THERE … … 93 98 . M @ZATTACH=GPL ; PUT IT IN THERE FOR NEXT TIME 94 99 S ZSUBJECT="TEST OF THE NEW MAILSEND ROUTINE" 95 D MAILSEND(.GR,ZFROM,"ZTO",,ZSUBJECT,"C0CGM",ZATTACH )100 D MAILSEND(.GR,ZFROM,"ZTO",,ZSUBJECT,"C0CGM",ZATTACH,"CCR.xml") 96 101 ZWR GR 97 102 Q 98 103 ; 99 MAILSEND(RTN,FROM,TO,CC,SUBJECT,MESSAGE,ATTACH,FLAGS) ; MAIL SENDING INTERFACE 104 LINE(C0CFILE,C0CTO) ; read a file name passed in C0CFILE and send it to 105 ; the email address in C0CTO 106 ; the directory and the "from" are all hard coded 107 ; 108 N ZZFROM S ZZFROM="LILLY.GEORGE" 109 N GN S GN=$NA(^TMP("C0CMIME2",$J)) 110 N GN1 S GN1=$NA(@GN@(1)) 111 K @GN 112 I '$D(C0CFILE) Q ; NO FILENAME PASSED 113 I '$D(C0CTO) S C0CTO="brooks.richard@securemail.opensourcevista.net" 114 S ZZTO(C0CTO)="" 115 N ZMESS S ZMESS(1)="file transmission from wvehr3-09" 116 N GD S GD="/home/wvehr3-09/EHR/" ; directory 117 I '$$FTG^%ZISH(GD,C0CFILE,GN1,3) Q D ; 118 . W !,"error reading file",C0CFILE 119 D MAILSEND(.ZRTN,ZZFROM,"ZZTO",,"file transmission","ZMESS",GN,C0CFILE) 120 K @GN ; CLEAN UP 121 ;ZWR ZRTN 122 W !,$G(ZRTN(1)) 123 Q 124 ; 125 MAILSEND(RTN,FROM,TO,CC,SUBJECT,MESSAGE,ATTACH,FNAME,FLAGS) ; MAIL SENDING INTERFACE 100 126 ; RTN IS THE RETURN ARRAY PASSED BY REFERENCE 101 127 ; FROM IS PASSED BY VALUE AND IS THE EMAIL ADDRESS OF THE SENDER … … 107 133 ; MESSAGE IS PASSED BY NAME AND IS AN ARRAY OF TEXT 108 134 ; ATTACH IS PASSED BY NAME AND IS AN XML OR HTML FILE TO BE ATTACHED 109 ; 135 ; FNAME IS THE FILENAME OF THE ATTACHMENT, DEFAULT IS ccr.xml 136 ; 137 I '$D(FNAME) S FNAME="ccr.xml" ; default filename 110 138 N GN 111 139 S GN=$NA(^TMP($J,"C0CMIME")) … … 113 141 S GM(1)="MIME-Version: 1.0" 114 142 S GM(2)="Content-Type: multipart/mixed; boudary=""1234567""" 115 S GM(3)=" 116 S GM(4)=" 143 S GM(3)="" 144 S GM(4)="" 117 145 ;S GM(5)="--123456788888" 118 146 ;S GM(5)=$$REPEAT^XLFSTR("-",$L(X)) 119 147 S GM(5)="--123456899999" 120 S GM(6)="Content-Type: text/xml; name=" "ccr.xml"""148 S GM(6)="Content-Type: text/xml; name="_FNAME 121 149 S GM(7)="Content-Transfer-Encoding: base64" 122 S GM(8)="Content-Disposition: attachment; filename=" "ccr.xml"""123 S GM(9)=" 124 S GM(10)=" 150 S GM(8)="Content-Disposition: attachment; filename="_FNAME 151 S GM(9)="" 152 S GM(10)="" ; FOR THE END 125 153 ;S GM(11)="--123456788888--" 126 154 S GM(11)="--123456899999--" 127 S GM(12)=" 128 S GM(13)=" 155 S GM(12)="" 156 S GM(13)="" 129 157 S GG(1)="--123456899999" 130 158 S GG(2)="Content-Type: text/plain; charset=ISO-8859-1; format=flowed" 131 159 S GG(3)="Content-Transfer-Encoding: 7bit" 132 S GG(4)=" 160 S GG(4)="" 133 161 S GG(5)="This is a test message." 134 162 S GG(6)="A Continuity of Care record is attached" … … 136 164 S GG(8)="It is purely test data used for software development" 137 165 S GG(9)="It does not represent information about any person living or dead" 138 S GG(10)=" 166 S GG(10)="" 139 167 S GG(11)="--123456899999--" 140 168 ;S GG(11)="Content-Type: text/plain; charset=""us-ascii""" 141 S GG(12)=" 169 S GG(12)="" 142 170 ;S GG(13)="This is a test message." 143 171 S GG(14)="A Continuity of Care record is attached" … … 145 173 S GG(16)="It is purely test data used for software development" 146 174 S GG(17)="It does not represent information about any person living or dead" 147 S GG(18)=" 175 S GG(18)="" 148 176 S GG(19)="--123456899999" 149 177 S GG(20)="--987654321--" … … 183 211 S GM(1)="MIME-Version: 1.0" 184 212 S GM(2)="Content-Type: multipart/mixed; boudary=""1234567""" 185 S GM(3)=" 186 S GM(4)=" 213 S GM(3)="" 214 S GM(4)="" 187 215 S GM(5)="--1234567" 188 216 ;S GM(5)=$$REPEAT^XLFSTR("-",$L(X)) … … 191 219 S GM(8)="Content-Disposition: attachment; filename=""ccr.xml""" 192 220 ;S GM(6)=$$UUBEGFN^LRSRVR2A("CCR.xml") 193 S GM(9)=" 194 S GM(10)=" 221 S GM(9)="" 222 S GM(10)="" ; FOR THE END 195 223 S GM(11)="--frontier--" 196 224 S GM(12)="." 197 S GM(13)=" 225 S GM(13)="" 198 226 K GBLD 199 227 ;D QUEUE^C0CXPATH("GBLD","GM",1,9) … … 232 260 S GM(1)="MIME-Version: 1.0" 233 261 S GM(2)="Content-Type: multipart/mixed; boudary=""1234567""" 234 S GM(3)=" 235 S GM(4)=" 262 S GM(3)="" 263 S GM(4)="" 236 264 S GM(5)="--1234567" 237 265 ;S GM(5)=$$REPEAT^XLFSTR("-",$L(X)) … … 240 268 S GM(8)="Content-Disposition: attachment; filename=""ccr.xml""" 241 269 ;S GM(6)=$$UUBEGFN^LRSRVR2A("CCR.xml") 242 S GM(9)=" 243 S GM(10)=" 270 S GM(9)="" 271 S GM(10)="" ; FOR THE END 244 272 S GM(11)="--1234567--" 245 S GM(12)=" 246 S GM(13)=" 273 S GM(12)="" 274 S GM(13)="" 247 275 K GBLD 248 276 D QUEUE^C0CXPATH("GBLD","GM",5,9)
Note:
See TracChangeset
for help on using the changeset viewer.