Type Mismatch when sending email with attachment in smtpmail.p

simedarby

New Member
Hi Guys,

Has any one of you encountered this error using smtpmail.r before?

Heres my test program calling smtpmail program. Im actually sending two attachment files to two email addresses.
Dont know exactly what I missed here but im getting error.

DEF VAR oSuccessful AS LOGICAL NO-UNDO.
DEF VAR vMessage AS CHARACTER NO-UNDO.
DEF VAR p-smtp AS CHAR FORMAT "x(20)" init "192.1.1.1".
DEF VAR p-email AS CHAR FORMAT "x(150)" init
"<testmail@yahoo.com>,<testmail2@yahoo.com>".
DEF
VAR p-emailfrom AS CHAR INIT "<auto_email_from_testmail3@yahoo.com>".
DEF
VAR v-subject AS CHAR INIT "THIS IS ONLY A TEST SUBJECT".
DEF VAR vLogFile AS CHAR INIT "Text message with file
attachment Reply if you receive this!".
DEF VAR t-AttachementList AS CHAR
INIT "attach1.csv:type=application/excel:filetype=binary,attach2.csv:type=application/excel:filetype=binary".
DEF VAR t-filelist AS CHAR INIT
"/home/gdms/tmp/attach1.csv,/home/gdms/tmp/attach2.csv".

OUTPUT TO '/home/gdms/tmp/chkmail.txt'.
PUT 'p-smtp ' + p-smtp FORMAT "x(30)" SKIP (1)
'p-email ' + p-email FORMAT "x(120)" SKIP (1)
'p-emailfrom ' + p-emailfrom FORMAT "x(60)" SKIP (1)
'p-attach ' + t-AttachementList FORMAT "x(180)" SKIP (1)
'p-filelist ' + t-filelist FORMAT
"x(180)" SKIP (1)
'v-subject ' + v-subject FORMAT "x(120)" SKIP (1)
'vLogFile ' + vLogFile FORMAT "x(120)" SKIP .
OUTPUT CLOSE.

RUN smtpmail (INPUT p-smtp,
INPUT p-email,
INPUT p-emailfrom,
INPUT "",
INPUT t-AttachementList,
INPUT t-filelist,
INPUT v-subject,
INPUT vLogFile,
INPUT "",
INPUT "multipart/related",
INPUT 2, /* Importance*/
INPUT NO, /* L_DoAUTH */
INPUT "", /* C_AuthType*/
INPUT "", /* C_User */
INPUT "", /* C_Password*/
OUTPUT oSuccessful,
OUTPUT vMessage) NO-ERROR.

IF ERROR-STATUS:ERROR THEN MESSAGE 'SENDING FAILED'.
ELSE DO:
MESSAGE oSuccessful.
MESSAGE vMessage.
END.
Your help is much appreciated.
Thanks in Advance,
Ferdie Banu
 
It would help if you told us at least what the error is you're receiving. It would also help if you posted any details of debugging you've tried. Have you attempted to send it to 1 address only? Does that work? Have you attempted to send without the attachment? Does that work?
 
Hi, our smtpmail.p is being used for quite sometime now and its stable. We have two deployments of smtpmail.p, one is in IBM AIX (Chui) and another is in appserver (also in unix), Both of them is in same box. I am doing a test on how to attach a .csv files. I run the program in Chui (same code above) and its successful, I received an email together with attachment. Then I ran an appserver program (same program above) calling smtpmail, but then it returns "Mismatched parameter types passed to procedure smtpmail.r". I dont know which of the parameters has an error. Same program it works only in Chui, but not in AppServer.

Im not sure if the parameters 5 to 10 is correct.

Any Ideas? Please Help.

Thanks in advance,

Ferdie
 
Hi Cringer,

I made another round of test in AppServer, same code above except that I removed the attachment and local files parameter. It sends an email succesfully. if the problem is in parameter attachment and local files what should be the proper systax for attching a .csv file?

The current syntax for attachment is "attach1.csv:type=application/excel:filetype=binary,attach2.csv:type=application/excel:filetype=binary" not so sure if i have an error in this portion.

Please Help.

Thanks in advance,

Ferdie
 
Hi Guys,

Another rounf of test, I include again the attachment and local files. My message alert in program says that the mail was succesfully sent But i receved nothing. I check the appserver log and I got this error messages:

[10/02/17@23:27:46.405+0800] P-4755608 T-000000 0 AS -- Put/Get functions not allowed on uninitialised memory. (2914) [10/02/17@23:27:46.406+0800] P-4755608 T-000000 0 AS -- ** 4GL Debug-Alert Stack Trace ** [10/02/17@23:27:46.406+0800] P-4755608 T-000000 0 AS -- --> readHandler smtpmail (/home/gdms/sg/rmlobjtrain/smtpmail.r) at line 1091 [10/02/17@23:27:46.406+0800] P-4755608 T-000000 0 AS -- smtpmail (/home/gdms/sg/rmlobjtrain/smtpmail.r) at line 638 [10/02/17@23:27:46.406+0800] P-4755608 T-000000 0 AS -- st02099b (/home/gdms/sg/webobj/rmltrain/appserver/st02099b.r) at line 406

ANy Ideas? Please Help.

THanks in advance,

Ferdie
 
GDMS ???
My god, I worked on this product for 8 years.
Ferdie, where are you ? Singapore or HongKong ?

I was the person who initially installed in SimeDarby in Singapore.

Benji
 
Back
Top