17
Views
10
Comments
Solved
Attach Single File To Email From Network Drive
Question

Good Day All....

Hopefully this will be a quick resolution.....I am attempting to attach a file to an email like so: as you can I have tried both by IP and Device name.

When I go to the email sent, I get the following attachment.....it is seeing the whole path as the file name.

Rank: #171
Solution

Hi Frank,

I don't think you can do in this way.

The file name property is just to specify the Name of the file that will be attached in the email, so it is just a text.

What you use in this field will be just the File name in your email.


To be able to attach a file that is mapped from a network driver from your OutSystems server I believe you will have to use something like this component to get the binary content of the file in your preparation, and then use it as the File Content of your attach email action.


Another solution that would be much more easy, would be add the file as a resource in your module and reference its content in the File Content property of your attach email action. 

But the file would not be dynamic (would always be the same), the only way to change it, would be changing manually in your module and publishing it again.


Hope it help.


Cheers and Regards,

RR :)

Rank: #1513

Thank you for the reply.   So, without a 3rd party download I would not be able to achieve this?          

Rank: #171

Hi Frank,

Yes!

To be able to use this attach file action, you have to provide the content of the file as binary data type.

And for it you will have to get this file in binary data format somehow in your code.

One of the possible ways to do it, is to use the component I mentioned, that let you manage files directly in your server using some server actions for example.

One of the action is a "download file from server" that you can use.


Cheers and Regards,

RR :)

Rank: #1513

Maybe this will explain a little better.   I have watched this video and have the email working fine, but I wanted to expand on this by adding a File Attachment.   I have tried the Manual approach  which apparently does not work.  If you look at this video, can an attachment via the UPLOAD widget possibly work?  

Thanks again,

FrankCLT

 

https://www.youtube.com/watch?v=ks5CbksqED8&t=0s

Rank: #171

Hey Frank,

You are using a Traditional Web App (TWA) or a Reactive Web App (RWA)?

This approach would be to send an email in the RWA, that for now, don't have emails as a default function.


About the upload, you can't call an "upload action" in a server action.


What you can do however, is use an upload widget in the screen to make a user select a file, and get this file content to use as the content of your attach file action in email preparation, for example.


Since the file can be very big, try to save it in an Entity and get its content in preparation also via an aggregate.


Cheers and Regards,

RR :)



Rank: #1513

Good Morning,

I am using a RWA as the input for the From and To for the email and it calls a Server Action that is in the TWA to do the email send and attachment (this is still not working)

Thank you,

FrankCLT

Rank: #370

Hi Frank,

It's like Raphael explained.
In the preparation of your e-mail, you get the binary of the file using the FileSystem component. This returns the binary that you can pass to parameter FileContent of the AttachFile widget.

Regards,
Lennart

Rank: #1513

Hello All,

Thanks for all the assistance...I do have the Email and Attachments working as designed.   What I'm having an issue with is the means of monitoring a Mail Box for emails.   We are attempting to create a kind of Work Flow.

The process is to work like so:

End User One sends an Email "EndUser2@EmailAddress.Com"

End User 2 Reviews Email and sends response to "Response@EmailAddress.Com"

Our goal is to be able to monitor the "Response@EmailAddress.Com"  from within OutSystems


Thanks in advance,

FrankCLT



Rank: #171

Hello again Frank,

This is a little bit more complicated, 

Take a look in this topic and this other one to see if helps.

Cheers and Regards,

RR :)

Rank: #1513

Thank you, yes, I have looked at those as well.....I was attempting to use the following, but receive the error that is shown as i run through debug.  



For the below settings I have tried different security protocols as well,  but all ended the same.....



Thanks again,

FrankCLT