Progress - How can I send a file attached to an email through

   
Vista:

How can I send a file attached to an email through

Publicado por Guillermo Sanchez (2 intervenciones) el 05/09/2009 02:06:01
I really appreciated your assistance


thanks a lot
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:How can I send a file attached to an email thro

Publicado por yorkino (5 intervenciones) el 22/01/2010 16:18:02
You can use a UNIX command, it's very easy!
this is the way tha I do this procedure:

1.- I made a .txt file with the text that my mail will have.
2.- In my .p file declare input and private variables:
mSubject for the Title of the mail
mMail for the directions mails separate by comas (,)
mBody for the text that will have your mail

mInstruction I use this to make my instruction.
mFile I use it to indicate the path of my .txt file.

3.- First get the body of your mail and pass the value to the variable mBody.
4.- Create the instruction UNIX to send the e-mail.
5.- Run the instruction to send the e-mail.

Finally, this .p file that I do, I run it form my HTML aplication, or whatever other apliaction.
Here is my code:

DEFINE INPUT PARAMETER mSubject AS CHAR NO-UNDO.
DEFINE INPUT PARAMETER mMail AS CHAR NO-UNDO.
DEFINE INPUT PARAMETER mBody AS CHAR NO-UNDO.

DEFINE VARIABLE mINSTRUCTION AS CHAR NO-UNDO.
DEFINE VARIABLE mFile AS CHAR NO-UNDO.

/* Write the .txt file, int the variable */
mFile = "/usr/brokers/testing/body_mail.txt".
OUTPUT TO VALUE(mFile).
PUT UNFORMAT mBody SKIP.
OUTPUT CLOSE.

/* Create and run the Unix instruccion to send the e.mail */
mINSTRUCTION = '$ ps aux | mail -s "' + mSubject + '" ' + mMail + ' < ' + mFile.
UNIX SILENT VALUE(mINSTRUCTION).

To send a filed attached just need to add the instrucction "uuencode /aplicacion3/reportes.log reportes.log" befor the mail instruction. I guess!!

Just look for the instrucction in google it's a UNIX command, create the instruccion and then run it in progress with UNIX SILENT command

I hope these help you,
by the way sorry about my english!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar