Is there a way to Get email and attachments from outlook add in using Client side JS? - office-addins

We are working on an outlook add-in which needs to send current email message as a .eml or .msg file and needs to be uploaded to SharePoint. Is there any Client Side JS for getting the email? Was looking to avoid any server side code if possible.
Thanks,

Related

Error "invalid_client" when trying to get a token from Microsoft API

I'm trying to develop a drive solution (Onedrive) in a windev program.
I created an application in Microsoft Azure and created a secret key.
When doing the first request https://login.live.com/oauth20_authorize.srf?client_id={client_id}&scope={scope} &response_type=code&redirect_uri={redirect_uri} I'm redirected on the connection page.
Once I'm connected I get a code back as https://login.live.com/oauth20_authorize.srf?code={code}.
But when I ask for a token posting this request : POST https://login.live.com/oauth20_token.srf Content-Type: application/x-www-form-urlencoded client_id={client_id}&redirect_uri={redirect_uri}&client_secret={client_secret} &code={code}&grant_type=authorization_code
I get this back
{ "error":"invalid_client", "error_description":"The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at https:\/\/go.microsoft.com\/fwlink\/?linkid=2083908.", "correlation_id":"471e800c-69b4-43c6-a03f-a1f7e9512e6b" }
Thank you for your help.
This error means you are using a Microsoft Account to login your client app, but it is not enabled for that.
To change the setting for an existing AD App, navigate to the Manifest blade of it in the portal, find the signInAudience attribute, set it with AzureADandPersonalMicrosoftAccount or PersonalMicrosoftAccount.

Azure Logic App: How to keep embedded image in email body when forwarding on?

I am setting up a bulk emailing solution combining Logic Apps and SendGrid.
User sends email to a mailbox with attachment of required recipients > Logic App reads email > LA resends 'Body' via SendGrid for each recipient.
This works fine with a plain email. However, when an image is embedded within the body Outlook uses Content-IDs.
Currently the body of the email just says a broken image symbol.
How can the images be kept for the re-sending on?
enter image description here
If you want to implement it directly, it could be done. Because if you try to get the mail body you will find it's like below picture.
The body is escaped mail content and the image content is the contentBytes under attachments it's a base64 code.
So if you want to send a image from another mail you have to get the base64 code embed it to your mail. I use the outlook trigger to test it and send with sendgrid, the content will be like this code.
This is test email <br>\n<img src=\"data:image/jpeg;base64,#{triggerBody()['attachments'][0]['contentBytes']}\">
I test this way could send the image, and it could be seen in the mail. If this is not what you want please let know.

how can I send emails from react using sendinblue?

I am working in React applications (using the .net core in the back-end)
I have to send emails from the client side , we have to use sendinblue instead of mailgun , I need your help
You should not send emails from the client side.
Consider that in doing so, you're going to expose your API Key to any client, leading to a severe vulnerability for your application (anyone could impersonate you and send emails as if they were you).
In order to really make that work, you should perform an AJAX request to your server and there, connect to the Sendinblue API and make the request to send the email. In this case, the API Key could be safely stored in your server.

"The submitted data was not a file" error uploading images with Django REST Framework

I have a Django Rest API for adding multiple images to a database. I am using React JS as my client side and to need to upload multiple images. I am using
this component for uploading images in the client side.
https://ant.design/components/upload/
When calling the Django REST API, it shows the error "the submitted data was not a file. Check the encoding type on the form."

How to get thumbnail of an image in ejabberd

I uploaded a image/video on ejabberd server using my client and ejabbered in its response sends a url where that image resides.Now client triggers a request on that url and file download starts.What i want to do is basically first send the client a low quality thumbnail(So that if a video is very large and takes time to download ,in that time client will show that blurred image(As in whats app)).How to create this Thumbnail?Any idea?
It looks to me this is a purely client side protocol. Just have the client passing the download information have a link to thumbnail URL as well.

Resources