Outlook Office Add-In Integration with Third-Party Web Application - alternative to mailto links to support attachments and HTML body - javascript

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.

Related

Set Delay Delivery on emails using Outlook Javascript API

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.

Is there a way to instantly send an e-mail using "mailto" in CSS (or any language-related to web development) without opening Outlook or Apple Mail?

I'm trying to create a personal website that has a contact form -- message box, for example -- but whenever I click submit or send, it opens up my Outlook e-mail, collects all the data I wrote down and then I have to click send again in Outlook to finally deliver that e-mail to someone. I'm new to webDev, so I'm just wondering if it's possible.
mailto: URLs are very unreliable and (when they work) always interact with the mail client on the user's machine.
Any solution involving submitting a form to a web server and sending email using server-side programming won't.
Use a server-side solution. Third-party hosted options exist if you don't want to do any server-side programming yourself.
The way to do this is to use a form to send data to your server. Your server then connects to an SMTP server to send the email.
If web pages could send emails on behalf of people without interaction, this would be used for spam.
It is not possible to directly send email from the web browser, whether it is CSS, HTML, nor Javascript.
I'm assuming that you'd like a contact page which would allow anyone visiting to fill in a small form which notifies you by email when they submit it?
unfortunately, this isn't possible using only css, html or javascript - which are the tools available to you in the web browser.
If you're willing to go a little deeper, then this is entirely possible given a server-side application. It's common to do this kind of thing in PHP, but any server-side language would be able to do this. You would need to do some set-up if you wanted to do it yourself, things like setting up a mail server to send outgoing mail. These things can be tricky. I'm sure that there are also many hosted options available, but I'm afraid I don't know of any.

Remove a Resource from an Outlook Appointment

In my O365/Outlook add-in, using the Office JavaScript API, I am trying to manage attendees and resources.
Office.context.mailbox.item.requiredAttendees.getAsync
and
Office.context.mailbox.item.requiredAttendees.setAsync
has worked well for me so far, however Outlook will take email addresses that are set up as resource calendars and resolve them as resources.
Once this happens I can't seem to access or manipulate them.
Office.context.mailbox.item.resources is undefined.
Resources are not supported in Compose currently. However, we track Outlook add-in feature requests on ourĀ user-voice page.
It looks like the feature you want has been requested by others already. Please upvote the existing request. Feature requests on user-voice are considered when we go through our planning process.

Programatically connecting to a website on a server from another website

Is it possible to connect a server to a website, where I can access the server from another website and if I click submit, it programmatically clicks a button on the website connected to the server?
Is this possible to do in Javascript(if not, any idea on how to implement this?)
Based on the comments you've provided, your question seems to be specific to gmail. If that is the case, google offers an API that will let you perform operations from your code that would normally be performed by a user.
https://developers.google.com/gmail/api/
From the site:
What is the Gmail API?
The Gmail API gives you flexible, RESTful access to the user's inbox,
with a natural interface to Threads, Messages, Labels, Drafts, and
History. From the modern language of your choice, your app can use the
API to add Gmail features like:
Read messages from Gmail
Send email messages
Modify the labels applied to messages and threads
Search for specific messages and threads
This is possible on any development environment I used this in C# Asp.net and in python. Simply you can use a WebClient object in asp.net. You can click any button and you can set any area on target machine like for user login name and password. Even robot control on logins is exist just for this reason
http://www.codeproject.com/Tips/488939/Get-page-HTML-from-URL-using-WebClient-Strip-HTML
Can't login into asp.net website with WebClient

Sending Outlook Email to SQL Table using either Javascript or SQL Server

I have built some functionality in a mobile GIS application called GeoMedia Smart Client which allows the user to fill out email details in a form, which then opens Outlook to allow them to send the email. The functionality uses Javascript and XML workflows to populate the email with the values from the form as well as automatically populating asset details in the body.
I have built a SQL Server table to save these emails with Date Sent, From, To, Subject, Body etc. This table is populated via a SQL trigger in Smart Client. The problem is, the user has the option of editing the email in Outlook or Smart Client. Any edits in Outlook won't be saved in the SQL table as the trigger only runs in Smart Client. Is there a way using either SQL or Javascript to send the Recipient, Subject, Body etc from the open email in Outlook to the SQL table? I realise Javascript is client side and SQL is server side.
I know it's bad design having the ability to edit the email in either Smart Client or Outlook, but the other option using SMTP had it's own problems with our IT department and security issues allowing external Smart Client users access to the server.
Hopefully that makes sense,
Regards
Josh
You can develop a VBA macro or add-in where can handle the Outlook object model events and save the changes made by a user or programmatically to the SQL database. Also you may consider developing a custom UI for Outlook where users can save emails directly to the db without other software involved.
See Getting Started with VBA in Outlook 2010 to develop a VBA macro. Be aware, VBA macros are not designed for distributing the code on multiple PCs. If you need to get the solution working for multiple users, see Walkthrough: Creating Your First Application-Level Add-in for Outlook.

Categories