Outlook : Hide automatically the client signature - outlook

I'm trying to create an Outlook add-in that creates a new email using the following method:
Office.context.mailbox.displayNewMessageForm({
toRecipients: ["firstname.name#email.com"],
subject: mailSubject,
htmlBody: mailBody
});
But I encountered an issue:
On the desktop version of Outlook (Windows 10), the new email is created without my signature (that's what I looking for)
On the OWA version, the new email is created with my signature and it appears in the middle of my content (that's really weird).
I want to disable the client signature on the OWA version because it appears inside the message that I want to display in the email (it doesn't appear at the end of the message ...).
Do you know why there are two behaviours between desktop version and OWA?
I saw the following example of a method that allow to disable the client signature but it's only on the Preview version of the Office API: https://github.com/OfficeDev/office-js-snippets/blob/master/samples/outlook/99-preview-apis/work-with-client-signatures.yaml
I'm running the latest version of the API on OWA (1.9), that's why I need your help.
Thank you
[Edit: 2021/02/01]
Here's my client signature that's set by default when I compose a new email.

Well, I reset my signature and now (with the same parameters as before), the issue seems to be solved. No explanation...
Thanks for you help!

Related

Cannot send SMTP Email from Outlook VSTO Addin

I have a SendEmail method developed with System.Net.Mail that works fine. Calling it from my VSTO Outlook Addin, I get an error: A call to SSPI failed. The inner error contains "Function not supported".
I tried to send the same email from a regular c# environment (that worked), and from my Outlook VSTO add-in that did not.
Is there a reason why the smtp email cannot be sent from the Addin?
Solution (thanks to Eugene), I added
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
to the SendEmail method and now the Emails are sent.
Given the nature of the exception, it seems like you're more likely to have an email server problem than anything else.
Also it makes sense to check what TLS version is used in the code. SSPI stands for Security Support Provider Interface, so it makes sense try to find the difference between two .net applications. TLS is a starting point, see How to enable TLS 1.2 for more information.
You may consider your Outlook VSTO add-in as a regular .net application. There are minor differences like availability of configurations files and etc. If you need to put something into a config file you need to create a config for the host application which is Outlook in your case. Keep that in mind when developing VSTO add-ins.

How to send an email from an outlook office add on?

I am trying to build an outlook add on, using react. I looked everywhere trying to find something that uses the mailbox in which the addon has been opened from, to programmatically send an email to a specified user.
Something similar to the google's command:
GmailApp.createDraft(e.parameters.address, e.parameters.subject, e.parameters.body, {
htmlBody: e.parameters.body,
name: 'Automatic Sender'
}).send();
Is the mail-sending process available on outlook?
Outlook web add-ins work under the context of currently selected item only. OfficeJS doesn't provide anything for creating and sending emails programmatically.
In Outlook add-ins you may consider using EWS, see Call web services from an Outlook add-in for more information. Also you may take a look at the Graph API as a possible workaround.

Outlook and Gmail Link to create event

I'm using outlook and gmail links to create events.
I populate the params for each link and publishing it to the users.
The link for outlook:
https://outlook.office.com/owa/?path=/calendar/action/compose&rru=addevent&startdt=2021-05-24T12:00:00&enddt=2021-05-26T19:00:00&subject=Change This With A Subject &location=Change This With A Location&body=Change This With A Body Description.
My question is:
It's possible to click, for example, on outlook link (like the link above) to create the event, but somehow make it open the Desktop outlook app and not outlook web?
Many Thanks,
For the URL specified - no. They are run by web browsers by default.
URLs with the https protocol handler are run by web browsers. But you can register a custom protocol handler on a client machine that can launch Outlook by default and pass parameters as you do for a web browser. Read more about that in the Understanding Protocol Handlers article.
Also, you may find Outlook command-line switches helpful, see Command line switches for Outlook 365, 2019, 2016, 2013, 2010 and previous for more information.

Outlook add-in - attachment ID's not working correctly in desktop app, but work on web app

I've developed an add-in for Outlook, it needs to be able to access attachments to emails.
On the desktop app, if I move an email with attachments from a shared folder to my main inbox, then try to run the add-in on it, i get the error:
The specified attachment Id is invalid.
However, if I perform exactly the same operation through the web app, it works fine.
I have checked and the Office.context.mailbox.item.itemId and Office.context.mailbox.item.attachments[i].id are exactly the same whether on web or desktop.
Emails with attachments that have not been moved from a different folder, and emails without attachments work fine.
I am fetching the attachment on a remote server through a PHP script, using a callback token I orginally get from Office.context.mailbox.getCallbackTokenAsync. The requests are made via EWS requests.
I am running Office 365 and the Outlook version is 1910 (Build 12130.20390), running on Windows 10.
Can somebody please help?
After some helpful suggestions from #OutlookAdd-insTeam-MSFT, I've come to a solution for this.
The problem is, after moving a message from a shared folder to the main inbox, when using the desktop app, the Office.context.mailbox.item.attachments (created when we run Office.initialize) no longer returns the correct ID's, instead it seems to return the old cached/out of date ID's from before the email was moved. The ID's returned when using the web app are correct using this method.
However, requesting the ID's from the exchange server, via an EWS request (or a REST call, but I use EWS) always returns the correct attachment ID's, whether called from the web app or the desktop app.
So, the solution I have come to is to make sure and request all of the attachment ID's from the exchange server, rather than using the Office.context.mailbox.item object. It means adding in an extra step of having to get a callback token first to then be able to request the info from the exchange server, but it means you always get the correct ID's.
I hope this is of help to someone else.

How to automate windows 10 email client from vb6 application

Our vb6 application allows users to open an email with an attachment in Outlook (user clicking on cmdEmail opens Outlook in new process with details populated and a document attached). I've been asked to extend this so that an email with attachment can be opened in the new Windows 10 mail app.
Is anyone aware of any way to do this?
I've tried a few avenues:
I can't use mailto: because of the attachment requirement. I can create the email in the win10 app, but Attachment= or Attach= don't work
I've tried Simple MAPI and CDO but had trouble even getting it to work with Outlook because of an "unspecified error" when trying to send with showdialog = true, or a security warning when opening the address book when showdialog = false (although showing the client is a requirement). I've also read it's not supported by Outlook 2010 (or 2007 for CDO) so I'm doubtful it will be supported by the mail app.
The vb6 application automates Outlook by creating an Outlook.Application object (same sort of method as shown here https://support.microsoft.com/en-us/kb/220595). Is there anyway to recreate this sort of logic with the Mail app? I can't see any object models online or see an object library in my program files.
Has anyone else managed to do this, or might be able to suggest an avenue I can explore? I've not done anything like this before (even mailto was new to me) so any suggestion or point-in-a-direction would be appreciated
Thanks

Resources