How do I send HTML content from OneDrive Graph Api /sendMail endpoint? I have tried various permutations of HTML and encoded HTML in the body but I never receive HTML in the actual email.
-- Edit --
It turns out my problem is actually Outlook Online stripping unsafe HTML. If I include a link to Bing.com that gets stripped, if I include a link copied from one of my automated Teams emails that does not get stripped.
I have trawled the Office 365 Security and Compliance but found nothing to flag specific domains as safe.
If anyone knows how to mark domains as safe, or some other solution that would be great.
Related
Looks like the API only allows for sending a fax (https://www.twilio.com/docs/fax/send) - is there any way to validate via the API that the file can be faxed (to a reasonable extent e.g.: valid format/size/etc.) and how many pages it will be charged for BEFORE requesting that it be sent?
Also, are there any validation limitations I can put on the client side (for feedback purposes && disabling front-end form submissions for Files we know will fail)?
Twilio developer evangelist here.
The only format that the Twilio Fax API currently supports is PDF. So you can certainly validate before you try to send that the file must be a PDF.
If you are looking to validate for PDFs in the client side you can add the accept attribute to a file input field and only allow it to accept PDF files:
<input type="file" id="fax-file" accept=".pdf,application/pdf">
Since the files can only be PDFs, you could count the number of pages in the PDF to see how many you expect to be sent through and charged for. Though note that faxes are charged by the time taken to send the fax which depends on the quality as well as the number of pages. We normally estimate about 60 seconds per page though. I'm not an expert on PDFs though, so I'm not sure what else I'd try to do here. Hope this helps though.
I followed this documentation to download the attachments of email.
Below is the API response.
If email attachment type is FileAttachment, I am able to get the file content in api response and able to save the attachment.
If email attachment type is ItemAttachment, I am not able to get the file content in api response. When I googled for it, I found this stack overflow question. I used the rest API mentioned in the answer. But it's giving itemAttachment content in html format. And if that ItemAttachment has any fileattachment in it, then I am unable to access it.
Is there any API available to download the itemAttachment as .eml file not as html?
Any suggestion/answers would be more than welcome.
I assume by .eml you mean you'd like to retrieve the email in MIME format?
Retrieving an email's raw MIME content isn't supported by Microsoft Graph API at this time. This has been a common request and there is an existing UserVoice request for it.
If this is a hard requirement for your scenario, you may want to take a look at Exchange Web Services (EWS). The Message object returned by EWS includes a MimeContent property.
This is now supported on https://outlook.office365.com/api/v2.0/me/messages/<Message-Id>/$value endpoint
I'm building a Ruby on Rails app, and I'd like to integrate some Office365 features.
For instance : I would like to download a file from OneDrive and then attach it to an Email in order to send it via Outlook rest API.
I found this get Item content OneDrive REST API but I dont understand how to use it.
I understand that I have to send a GET request (formated as explained in msdn.microsoft.com) with Rails, which will then provide me a "a pre-authenticated download URL" to download the file.
Then I will have to send a second GET request with this a pre-authenticated download URL to start the download, but I don't understand how to deal with the Response in order to save the file into a variable.
How can I retrieve the file into a variable of my Ruby on Rails App, so that I can attach it to an Email with an Outlook REST API to send it from my own Rail controller ?
Also this workflow is really not optimized in term of Bandwidth and Processing (3 REST API request + 1 download + 1 upload), it will work.
However if it exist a single REST API that direclty attach a OneDrive file to an email to send it, that would ease a lot my life, save energy, save money from Microsoft datacenter, and spare the planet ecology.
Any tutorial, examples, or more explanatory doc would be much appreciated.
--- EDIT ---
Adding link to the email is not wished as the email may have to be send to someone outside of Office365 users, and public link are a security issue for confidential documents.
Any help is welcome.
There isn't a single REST API call you can make currently to do what you want, although being able to easily attach a file from OneDrive to a new email message is a great scenario for Microsoft Graph API, it just isn't supported right now.
If you want to attach the file, you need to do as you mentioned, download the contents of the file, and then upload it again as an attachment to the message.
However, I'd recommend sending a link to the file instead, even though you mentioned you don't want to do that. OneDrive for Business now supports "company shareable links" which are scoped to just the user's organization instead of being available totally anonymously.
Something else to consider: The security concerns of sending an anonymous link aren't that different than sending an attached file. In fact, the anonymous link can be more secure, because access to the file can be monitored and revoked in the future (unlike the attachment, which will always be out there).
I am currently using Grails Mail 1.0 plugin in my project. I used it to send verification link to registrant's email address. Unfortunately, the sent verification link is not clickable on some webmail services like hotmail and yahoo mail. I have also encountered same problem with other web browsers like mozilla and google chrome. Is this really a bug on the said plugin? Please help!
Is this really a bug on the said plugin?
Almost certainly not. I use the same plugin to send HTML emails and they render fine in Yahoo mail.
In general, you shouldn't rely on links in HTML email being rendered correctly, because some email programs may be configured to only read emails in plain text format. Also, the rendering of HTML content varies wildly from one email program to another.
For these reasons, you should generally provide a plain-text fallback, e.g.
To register, click here. If you're using
a rubbish email program, you won't be able to click the link, so
copy-paste the following link into your browser's address bar:
http://www.example.org
I am trying sending HTML e-mails using MAPI calls in my Delphi Application.
When the client is Thunderbird if works fine. But when the client is Microsoft Outlook or Outlook Express I need to save the HTML code in a file and send it as the first attachment of my message, elsewhere the mail client interpret the HTML as text, showing the tags.
Sending HTML as the first attachment works only when no more attachments are sent, because if I send one or more attachments the first (HTML) is also showed as an attachment.
Does somebody can help me?
Thanks in advance.
Douglas.
Message OK:
Ok http://www.freeimagehosting.net/uploads/e51dfa52f4.jpg
Bad Message (with one attachment):
Bad http://www.freeimagehosting.net/uploads/7e5689e2b9.jpg
If you find that Outlook/OutlookExpress can not handle HTML natively, it might just be that you are using a version of Outlook that isn't capable of, or isn't configured to default to HTML rich content by default. Have you tried reconfiguring your Outlook/OutlookExpress options to select HTML rich text by default?
It looks like it's actually working, but that Outlook does not display things correctly. An HTML email sent via a traditional email client, is actually mime-encoded, just as it shows there. In other words, you may find that if the email is sent, it appears fine on the other side, it's just a bug in outlook-express that you don't see the MIME attached content in the window, instead you see it as it is truly done internally, as a MIME encoded attachment.