In a Outlook addin I want to set PS_INTERNET_HEADERS properties on outgoing emails/meeting requests. I can see that for meetings those properties are not preserved when I open the incoming meeting (I send it to myself) - the email header for my property does not exist and I cannot see the property in OutlookSpy. for regular emails (not meetings) properties are preserved fine.
I can also reproduce this behavior with OutlookSpy - I create a new meeting, in OutlookSpy I add a PS_INTERNET_HEADERS named property, and send the meeting to myself. when I open the incoming meeting the property is gone. (it also does not appear when I open the meeting from the SentItems)
When and how do you set the properties? Keep in mind that AppointmentItem is never sent. When you call AppointmentItem.Send, a new MeetingItem object is created and sent. You can only access it in the Application.ItemSend event handler.
Related
I would like to display an information message for the user when he read a specific email (i.e the email is tagged as external). The message should be displayed in the same way as outlook categories.
I know that I can use Exchange transport rule to achieve that but my client don't want to modify the message itself. He prefers displaying a message in the UI without changing the email body. The other option is to use the Office.context.mailbox.item.notificationMessages interface but as I told, I don't want to modify the email item if possible.
Do you think it is doable with outlook JS addins ?
My need is similar to this one for VSTO addin: How can my Outlook VSTO Add-in modify the read email form?
The Office.context.mailbox.item.notificationMessages interface provides the addAsync method which accepts the JSONMessage parameter which represents a JSON object that contains the notification message to be added to the item. It contains a NotificationMessageDetails object. Among properties you can find the persistent property which specifies if the message should be persistent. Only applicable when type is InformationalMessage. If true, the message remains until removed by this add-in or dismissed by the user. If false, it is removed when the user navigates to a different item. For error notifications, the message persists until the user sees it once. Specifying this parameter for an unsupported type throws an exception.
In case of categories, the message will be modified.
Do you know if it's possible to execute the function as soon as the read form is opened without having to click on an action button ?
Web add-ins are run under the context of currently selected item only. You can pin a task pane, then you'll be able to register an event handler to get notified of the change. The event handler should accept a single parameter, which is an object literal. The type property of this object will be set to Office.EventType.ItemChanged. When the event is called, the Office.context.mailbox.item object is already updated to reflect the currently selected item.
Office.initialize = function (reason) {
$(document).ready(function () {
// Set up ItemChanged event
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, itemChanged);
});
};
function itemChanged(eventArgs) {
// Update on the new current item
}
Currently the event-based activation of add-in in Read mode is not supported. We track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered when we go through our planning process.
Currently, Event-based of activation of add-ins is only supported for Compose mode. You can explore more here- Configure your Outlook add-in for event-based activation - Office Add-ins | Microsoft Docs
I'm developing an Outlook add-in that allows the user to save an email to the filesystem just after it's been sent.
To achieve this, I intercept the Application.ItemSend event, and inside my handler I call MailItem.SaveAs(...). It works, basically.
The problem I'm facing is that, when I open the file saved, the email is in draft state. I mean, the recipients, subject and message body can be modified, and the email can be resent. I want the email to be in "sent" state, i.e. not modifiable.
It looks like Outlook API does not provide any event dispatched after the email is sent. Only before, and this is my pain.
Do you have any idea to perform this?
Thanks a lot for your help!
Nico
the earliest you can save the message in the sent state and with the sender properties populated is when Items.ItemAdd event fires on the Sent Items folder.
I am creating an addin for Outlook.
I want to check some text on sending, but im not sure how to reference it
The text is in the image below and says “Attachment will be sent using...”
If the text equals the text displayed, i want to do something.
Thanks for any advice.
The Outlook object model doesn't provide anything for reading mail tips. But you may consider using EWS for getting mail tips. See Using MailTips in EWS to get the OOF (Out of Office) Status of users with C# and Powershell for the sample code.
FYI MailTips are informative messages displayed to users in the infobar in Outlook Web App and Outlook 2010/2013/2016 when a user does any of the following while composing an e-mail message:
Add a recipient
Add an attachment
Reply or Reply all
Open a message from the Drafts folder that's already addressed to recipients
To configure MailTips for mailboxes, external contacts, and distribution groups, in the Exchange Control Panel, select the mailbox, external contact, or distribution group, click Details, and then in the MailTip section, create the MailTip.
To configure MailTips for mail users and dynamic distribution groups, in Windows PowerShell, use the MailTip parameter on the Set-MailUser and Set-DynamicDistributionGroup cmdlets.
Regardless of whether you use the Exchange Control Panel or Windows PowerShell, two things always happen when you add a MailTip to a recipient:
HTML tags are automatically added to the text. For example, if you enter the following text: This mailbox is not monitored. The MailTip automatically becomes the following: <html><body>This mailbox is not monitored.</body></html>
The text is automatically added to the MailTipTranslations property as the default value. If you modify the MailTip text, the default value is automatically updated in the MailTipTranslations property.
Read more about that in the Configure MailTips article.
I write an outlook add-in and I am new to it, so please elaborate.
When I am offline and attempt to send an MailItem, the MailItem is moved to outbox. However, I noticed (as per screenshot below), that it has "draft" icon and no date.
As a result, when I get online, it will never get sent.
How do I move it to outbox folder but have it land there not as a draft?
I move it lilke this:
(myItem as MailItem).Move(myOutboxFolder);
Why do you expect a message moved to the Outbox folder to become sent? You need to create it in the sent state (it cannot be changed later), and that means you can only create a PostItem, not MailItem.
To send a message, you need to call MailItem.Send. Moving it to the Outbox will not sent it - Outbox is just an eye candy.
I have mailbox "user1#somemail.com" and I manually changed MailItem.Sender field to "user2#somemail.com" and sent it to "user3#somemail.com". I discovered strange situation that i see email in "SentItems" folder in "user1#somemail.com" but "user3#somemail.com" not receive this message. I checked logs in Exchange server and i donæt see any error messages. Just for prof i did the same but not change MailItem.Sender property but used SentOnBehalf standart functionality. And "user3#somemail.com" receive it so issue not in permission. Just for check i used OutlookSpy and compare two emails(one email that i sent using SentOnBehalf standart functionality and outher email where i changed MailItem.Sender). You can see diferrences following. Can somebody say me where is my fault and why user not receive email when i change MailItem.Sender:
The Sender property is not meant to take a string value. You need to set it to an AddressEntry object for a user that has permissions to send from any of the loaded accounts in the current Outlook profile.
See MailItem.Sender Property:
http://msdn.microsoft.com/en-us/library/office/ff869056(v=office.15).aspx