- 论坛徽章:
- 0
|
Definition not found for symbol 'QtmmSendMail'
1,应该是API原型定义有问题,参考下面的程序;
2,今天是7月7日,心情很沉痛,不想看到鸟语.
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Wrk: Sample Email Program
* -----------------------------------
* Compile instructions:
*
* 1. CRTRPGMOD MODULE(xxxlib/TSNDME) SRCFILE(xxxlib/QRPGLESRC) SRCMBR(TSNDME)
* 2. CRTPGM PGM(xxxlib/TSNDME) MODULE(xxxlib/TSNDME)
* BNDSRVPGM(QTCP/QTMMSNDM)
*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
D* Prototype for QTMMSENDMAIL API
D qsndme PR ExtProc('QtmmSendMail')
D filename * Value
D nameLen 10i 0
D OrigAddr * Value
D OrigLe 10i 0
D RecipTbl * Value
D NbrRecips 10i 0
D pErr * Value
*
D* prototype of function to add recipients
D AddRecip PR 280
D inetAddr 256 value
D AddrType 2 value
D
* copy error structure from QSYSINC
D/copy qsysinc/qrpglesrc,qusec
D Qdata 17 216
D
* set pointer to Error structure
D pErr S * Inz(%addr(QUSEC))
D
* email variables
D RecipTbl S 32767a
D Filename S 255a
D inetAddr S 256a
D nameLen S 10i 0
D OrigAddr S 256a
D OrigLen S 10i 0
D NbrRecips S 10i 0
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* M A I N
*
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C* Initialize Error structure parms
C Eval Qusbavl = 0
C Eval Qusbprv = 216
C
C* load first recipient into table
C Eval inetAddr = 'xxx@163.com'
C Eval RecipTbl = %trim(Reciptbl) +
C %trim(AddRecip(inetAddr:' '))
C
C* load second recipient into table (carbon copy)
C Eval inetAddr = 'yyy@163.com'
C Eval RecipTbl = %trim(Reciptbl) +
C %trim(AddRecip(inetAddr:'CC'))
C
C* load all other info to field to be sent to API
C Eval Filename = '/NEW2989.TXT'
C Eval nameLen = %len(%trim(FileName))
C Eval OrigAddr = 'tt@orig_domain.com'
C Eval OrigLen = %len(%trim(OrigAddr))
C
C* be sure to set the TOTAL number of recipients
C Eval NbrRecips = 2
C
C* Send the email
C Callp qsndme(%addr(filename):namelen:
C %addr(Origaddr) riglen:
C %addr(RecipTbl):NbrRecips:pErr)
* end pgm
C Eval *inlr = *on
C Return
C*****************************************************************
C* AddRecip - function to add recipient to email
C*****************************************************************
P AddRecip b
D AddRecip PI 280
D InetAddr 256 value
D AddrType 2 value
* Addrtype values
* *blanks = normal ("To"
* 'CC' = carbon copy
* 'BC' = blind carbon copy
D
* ADDT0100 data structure - (See IBM Qtmmsendmail docs for
* details)
D tblWork DS
D NextOffset 9b 0
D AddrLen 9b 0
D AddrFmt 8
D DistType 9b 0
D Resrvd01 9b 0
D DestAddr 256
D
C
C* load recipient into structure
C Eval Addrfmt = 'ADDT0100'
C Eval Resrvd01 = 0
C
C Select
C* CC = carbon copy
C When AddrType = 'CC'
C Eval DistType = 1
C* BC = blind carbon copy
C When AddrType = 'BC'
C Eval DistType = 2
C* all other values will be normal
C Other
C Eval DistType = 0
C
C Endsl
C
C Eval DestAddr = inetAddr
C Eval Addrlen = %len(%trim(DestAddr))
C Eval NextOffset = 24 + Addrlen
C
C
C
C Return tblwork
P AddRecip e |
|