Hello everybody,
I am using the upload widget to add an attachment to an email, which is working fine. But when the email is sent with no file uploaded, I still get a .bin file as an attachment. The file name is AT00001.bin and the size is 270 Bytes.
How do I achieve, that there is no attachment at all, when the user in not uploading a file with the upload widget.
The binary data and the file name from the upload widget are saved in local variables, which are passed as input parameters to a server action, containing the "Send Email".
The variable which stores the binary data is set to NullBinary() after the email got sent in an client action.
When I am not using the attachment section in the Send Mail node, there is no .bin file attached to the email.
When I am using the attachment section, but don't pass anything to the FileContent variable, I get AT0001.bin attached to the email.
I have also tested with an empty email, so there should be no issue with any content from the email itself.
As a work around I have now 2 Send Mail nodes in the server action. One with attachment and one without using the attachment section. An If node is checking, if FileContent is null. When true it is using the Send Mail node without attachment.
Marc Fugger,
Have you checked the documentation for email attachment, if not please follow this link
https://success.outsystems.com/documentation/11/developing_an_application/implement_application_logic/emails_in_mobile_and_reactive_web_apps/adding_email_attachments/
Note: Your email screen should be defined in reactive app.
If your email screen is defined in a traditional app, then you need to attach the file in preparation by using a temporary Entity. Please find oml file.
ThanksPankaj
Hi Marc Fugger,
In the preparation of the email widget test for the size and don't append the attachment.
Hope that it helps you
just to add
Use BinaryDataSize action to check the size from the binarydata_api if < 300 bytes don't add the attachment
https://success.outsystems.com/documentation/11/reference/outsystems_apis/binarydata_api/
Hi Marc,
Note that it's not OutSystems that adds the ATT00001.bin, but your e-mail program. A simple google on "ATT00001.bin" will find you many examples. It might be caused by something in your e-mail body, containing binary data that the mail program can't convert (so it assumes it's data).
Have you checked the content of ATT00001.bin? Is there anything legible inside?
I think the issue is in the variable which stores the binary data is set to NullBinary()
This is creating this bin file.
Try not to send anything when there is no file attached.
Thanks