stegro
24th September 2013, 10:37
Hi,
I am trying to send a file via mailx. I do not have any experience with it so I copied the solution from tht forum. Unfortunately it doesn't work :confused:
So here is my code:
email.addr = "abs@d.com"
string sh.cmd(200)
sh.cmd = "mailx "
&"-s "
&strip$("test")
&" -r "
&strip$(email.addr)
&" "
&strip$("sender")
&" < "
&strip$(tmp.log)
rc = shell(sh.cmd, SHELL_CONFIRM)
I set on SHELL_CONFIRM to see the error message which is:
"The terminal emulator only supports ISO-8859/1"
:confused::confused::confused:
Thanks a lot in advance :)
bhushanchanda
24th September 2013, 10:46
Hi,
Found a similar Thread (http://www.baanboard.com/baanboard/showthread.php?t=5655).
May be it was solved by NPRao. You can try it.
Also,
email.addr = "abs@d.com"
string sh.cmd(200)
sh.cmd = "mailx "
& "-s "
& trim$("test")
& " -r "
& trim$(email.addr)
& " "
& trim$("sender")
& " < "
& trim$(tmp.log)
sh.cmd = trim$(sh.cmd)
rc = shell(sh.cmd, SHELL_CONFIRM)
I don't use Oracle so no idea about mailx. Just thought if I could help something with code. You can give it a try though.
stegro
24th September 2013, 11:09
thanks I know this thread actually it doesn't help me. I do not understand what NPRao means by "You can set the TERM value in your environment/configuration files -" ???
bhushanchanda
24th September 2013, 11:54
Hmm, if he gives a visit here, he ll definitely let you know. Btw, what are you trying to do with this :-
< tmp.log
Is it taking some parameter from this log file? I have never used it but just curious to know.
stegro
24th September 2013, 12:55
Well, I want to send the tmp.log, so I thought thats how to do it?
Anyway, I tried to run without this part, same error....
bhushanchanda
24th September 2013, 13:24
I guess you are missing something in this command, I am not a *nix user, so can't really help. You can use this link (http://unixhelp.ed.ac.uk/CGI/man-cgi?mailx) which might help you to build the command properly.
Else, just wait for someone to take you on the right way.
Anyway, here are some links that may help:-
Thread 1 (http://www.baanboard.com/baanboard/showthread.php?p=95689)
Thread 2 (http://www.baanboard.com/baanboard/showthread.php?t=14079)
Thread 3 (http://www.baanboard.com/baanboard/showthread.php?p=120563)
Also, you can try run.prog() instead of shell() because its deprecated in LN.
stegro
25th September 2013, 11:07
Thanks for you help. I am stuck on this problem - has somebody an idea?
bhushanchanda
25th September 2013, 11:24
Umm, can you create a batch file with the required commands and just use run.prog() function to execute it through your script?
stegro
30th September 2013, 12:06
Resolved now. I "just" had an error in my command, :-( , the subject matter was missing. As I corrected this it worked, althoug still the message "The terminal emulator only supports ISO-8859/1" is shown....
NPRao
30th September 2013, 23:08
Stegro,
If you are on LN version, I suggest you to use the CMF functionality (http://www.baanboard.com/programmers_manual_baanerp_help_emessage_connector_overview) with SMTP.
I found old code which used mailx, here is the snippet -
string comd(12), emailid(80), subject(50), args(256), file.path(128)
comd = "/bin/mailx"
args = " -s " & quoted.string(trim$(subject)) & " "& email.addr
e= run.prog(comd, args, RP_WAIT, trim$(file.path))
Resolved now. I "just" had an error in my command, :-( , the subject matter was missing. As I corrected this it worked, althoug still the message "The terminal emulator only supports ISO-8859/1" is shown....
As mentioned, the shell() because its deprecated in LN.
Check if your local info is ISO-8859-1, in the session User Data Template (ttams1110m000).