I am testing some code on Outlook 2016 & Outlook Web using Script Lab.
My use case is simple: when I click on a button in my addin, I want the email to be delivered 2 days after today when it is sent. I know it is possible directly in the interface but this is just a test for a biggest addin later.
I am trying to set the Delay Delivery (or Send Later on Outlook Web) feature on emails through the Javascript API.
I went on the API reference but I was not able to find how to change the Delay Delivery property of emails.
Is it possible to edit this property using the API?
Does anyone know how to do that?
Thank you for your help
OfficeJS doesn't provide anything for that out of the box. But you may consider using EWS, see Call web services from an Outlook add-in for more information. The How to: Delay sending an email message by using the EWS Managed API 2.0 article explains how to delay sending an email message by using the EWS Managed API.
Another possible option is Graph API.
Related
From our web application running in company network, I'm looking for an alternative way of "mailto" approach (since "mailto" supports plain text only for the body section and has no attachment support) for opening up a new message (email) popup in Outlook (company uses Outlook). I'm trying to implement this by JavaScript.
After some search, I think I have 2 options available:
Handling mail sending operation via our web application by opening a send mail popup, including attachment and nice looking html body template,
Trying to integrate our web application with an Outlook office add-in
This web application is for purchasing department and Outlook usage of them is high.
If option 1 has been chosen, I think there will be a need to present previous mail recipient suggestions and sent mail history page.
I'm not exactly sure that option 2 can be implemented, or provided by Outlook.
Any suggestions will be highly appreciated. Many thanks in advance.
IMHO the only reliable way to show a new message in Outlook from a browser other than IE is to dynamically create an EML (MIME) file with HTML body and attachments populated. Just make sure to add "X-Unsent: 1" MIME header to show the message as draft and avoid populating From/Sender MIME headers.
None of the options described are valid. And I will explain why:
The web application can use Graph API if you deal with O365 or EWS if you have Exchange on-premise profiles. In that case you could compose and send emails programmatically from your web application. But you need to handle all requests for the message history and etc. in the code. That's a lot of work I suppose! But if you don't need to show a list of messages like Outlook does, just to submit emails you could Graph API on the server to send emails.
Web add-ins are run under the context of currently selected mail/calendar items in Outlook. So, they don't have anything to help there.
Background:
Creating a project where a user can create/edit/delete a calendar events on my calendar without the need to authenticate themselves. They can add or remove users on that calendar event. I have credentials to my google account to authenticate the requests. I want to talk directly to google calendar api without the need to insert username/password (which I can provide from the backend, if required).
Technology:
PHP7.0/ SQL SERVER/ JavaScript
Issue/Requirement:
I have created the project in Google and added credentials for "service account key". I have all the required keys for creating the project. How do I talk to the google server directly without using a frontend page or console and directly go ahead with creating an event?
Any suggestions welcomed. On a time crunch here.
How to quickly set up a PHP project using Google Calendar API: https://developers.google.com/calendar/quickstart/php
How to authenticate with a service account using Google APIs on PHP: https://github.com/googleapis/google-api-php-client#authentication-with-service-accounts
How to create events using the Calendar API using PHP language: https://developers.google.com/calendar/create-events#metadata
Using all the examples above you should be able to easily build yourself the solution you want.
Furthermore, I would suggest you check out the community guidelines on how to ask good questions.
I'm using Outlook Web Add-in. I need a way to send an email automatically. Something similar to this:
var item = Office.context.mailbox.item;
item.displayReplyAllForm("Default Message");
but without showing the Reply Form. I need to send a message directly and
maybe only show a message like "replying... please wait" or something similar when I click the button.
How I can do that? Please help and thanks a lot.
You cannot do this from the JavaScript library directly. You would need to use Microsoft Graph API to handle sending the message. You can find instruction on how to do this in the documentation under Use the Outlook REST APIs from an Outlook add-in.
There are couple of solution one is with graph and another is with exchange api. For graph you need to little bit of extra work to get the token and auth flow working.
The other approach is to use exchange API, you don't need to do anything to do these calls you already have the authentication setup needed for you in dong this call.
Please see this documentation for the more details.
https://msdn.microsoft.com/en-us/library/office/dd633704(v=exchg.80).aspx
https://learn.microsoft.com/en-us/outlook/add-ins/web-services
If you want a client only solution you can directly call the Office.context.mailbox.makeEwsRequestAsync API (refer documentation here: https://dev.office.com/reference/add-ins/outlook/1.5/Office.context.mailbox?product=outlook)
To construct the soap request to be used in makeEWSRequest, you can use: https://msdn.microsoft.com/en-us/library/office/dn600292%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396
Note that makeEWSRequest is not supported in mobile clients.
You should ideally request for a graph token using getCallbackTokenAsync API and then use the graph APIs with the token to send the email. This should work on all clients and is a preferred way to accomplish this scenario.
I am making a web-bot that checks every day if I have a new work in my time table.
If there is a new work date then it must add it to my Google Calendar.
But how do I login with the Google Calendar API, because the web page is not accessed by users. So how do I do that?
There is no Google API docs for web bots. However I found a Github repo called Telegram bot using Google Calendar API. This bot can interact with Google Calendar API, allowing you to easily add/manage events.
According to their page, this is currently up and running and you may use it:
https://telegram.me/google_calendar_bot
Also, since you're not going to use manual authorization from users, service accounts might be able to help you in the log-in part.
I need to fetch recurrence data for appointments like Repeat, From, To fields. In addition, I also need to get daily, weekly, or monthly pattern details for my Outlook office Add-in while it is in compose mode.
In an Outlook web add-in when something is not available directly from Office.js library you can try to get access to those data using Exchange Web Services.
Fortunately, Office.js provides two ways to access EWS.
You can request directly the EWS with a SOAP request from your client app. See method makeEwsRequestAsync in Office.context.mailbox
You can get an EWS token, send it to your server and make the request from there. Then you can use a nice SDK such as this one. You will invoke the method getCallbackTokenAsync from Office.Context.mailblox to retrieve such a token. In this link you will find an example on how to use this technique to retrieve email attachments (not available in Office.js)
To answer more precisely, the EWS seems to expose the information you need regarding recurrence, To etc. for appointments, see this link.