<script language="Cache" method="RegOrder" arguments="orderid:%Integer" returntype="%Boolean">
s order=##class(MyPackage.Encomenda).%OpenId(orderid)
s subject="Your Subject" s from="[EMAIL PROTECTED]" s to="[EMAIL PROTECTED]"
s text=""
OPEN 2:(1:1)
USE 2
// This will let me use "Write" as in a Terminal
write "Projecto",?14,":",?16,order.Projecto,!
write "Cliente",?14,":",?16,order.Cliente.Nome,!
write "Ref. Cliente",?14,":",?16,order.EncomendaCliente,!
CLOSE 2
set i=1
while ($d(^SPOOL(1,i))) {
set x=^SPOOL(1,i)
set text=text_x
set i=i+1
}
kill ^SPOOL(1)
if $$^SendMail(from, to, subject, text) {
w "alert('Encomenda Registada');"
} else {
w "alert('Erro no Envio de Mail');"
q 0
}
q 1
</script>Bill McCormick wrote:
At the moment the temp file will be written to the location of the cache.dat. We have made a change here that will allow you to specify a physical location for all temp streams but it has not made it into the released product yet.
Nuno Canas wrote:
Ralf,
You can allways do a chmod 777 to that dir see in which user the file is created.
Then, create a temp subdir with the right permissions to that user that uses cache.
When creating the file, just add the absolute path to filename.
Of course you can use /tmp if you like.
Regards. Nuno
Ralf Huwald wrote:
Itamar,
I think, "chmod 777" is a workaround, which enables other users to write to
the namespace dir. Is there a class method / function, which i could use to
set the actual directory to a "tempdir"? I had a look at the %File class,
but only found methods to create directories...
Ralf
"Itamar" <itamar.at.visaovirtual.dot.com_dot_br> schrieb im Newsbeitrag news:[EMAIL PROTECTED]
Ralf,
in fact, Cach� is trying to write itself a temp file to deal with message
text stream.
It tries to write in your CACHE.DAT namespace directory.
When using terminal, you are probably loged in as root and so Cach� can
write in this directory.
In background mode your directory don't give permission to Cach� to write
(create) the temp files.
Just to make sure, try to chmod 777 your namespace directory. I have a similar problem with terminal X CSP running.
It would be good to know, which user Cach� assumes in each situation (bg
job, terminal, CSP, ActiveX, etc...)
IHTH,
Itamar
"Ralf Huwald" <ralf.huwald @ mosecker.de> escreveu na mensagem news:[EMAIL PROTECTED]
Itamar,
I changed the code and the result of the status code is: ERROR #5005: Cannot open file 'LTIFICJ43RQ.stream' Should i try to write the textdata to a tempfile, which is attached to
the
mail?
Ralf
"Itamar" <itamar.at.visaovirtual.dot.com_dot_br> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Ralf,
I had some problems with permissions in Linux. Try to get status code from Write(...) method and analyze it. Eg.: Set sc=MailMessage.TextData.Write(...) ...[Log it]
I think it will clarify the problem.
HTH,
Itamar
"Ralf Huwald" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED]
Hi!
My routine creates an email using %New.MailMessage. The mail is
filled
with
some textlines "Do MailMessage.TextData.Write(...)" and one
attachment
"Do
MailMessage.AttachFile(...)"
When sending the mail from the terminal, it works. When the mail is
sent
from a background process, the text is not transmitted.
Any ideas?
I am usinc Cach� 5.0.5 / Linux.
Thanks, Ralf
