How can I get the Mail ID from an email?

How can I get the Mail ID from an email?

You can use the following script in a Javascript Task.

  1. require("validation.js");

  2. task.parameters = {
  3.     MailVariable: {
  4.         description: "The variable containing IMailInfo mail item.",
  5.         category: "Settings",
  6.         type: { id: "variable", variableTypes: "object" },
  7.         order: 1,
  8.         validate: validation.required
  9.     },
  10.     MailIDVariable: {
  11.         description: "The variable that will receive the MailId.",
  12.         category: "Settings",
  13.         type: { id: "variable", variableTypes: "string" },
  14.         order: 2,
  15.         validate: validation.required
  16.     }
  17. };

  18. task.run = function () {
  19.     var mi = this.variables[this.parameters.MailVariable.value].value;
  20.     this.variables[this.parameters.MailIDVariable.value].value = mi.ID;
  21. };
Pass in a variable of type object with your mail item.
Get back the ID for the mail item in the variable of type string you specify in MailIDVariable.


    Book a Presales Call

     

    Are you new to COZYROC and evaluating our solutions? 
    Book a Presales Call with us now.

      • Related Articles

      • Where can I find the documentation for the Receive Mail Task?

        You can find documentation related to all the COZYROC SSIS+ Component Suite components from the main products page.  Specific documentation for the Receive Mail Task can be found at the following link.  For many of the components you can find ...
      • How can I get the Mail ID from an email?

        You can use the following script in a Javascript Task. require("validation.js"); task.parameters = { MailVariable: { description: "The variable containing IMailInfo mail item.", category: "Settings", type: { id: "variable", variableTypes: "object" }, ...
      • How can I get the Mail ID from an email?

        You can use the following script in a Javascript Task. require("validation.js"); task.parameters = { MailVariable: { description: "The variable containing IMailInfo mail item.", category: "Settings", type: { id: "variable", variableTypes: "object" }, ...
      • How can I get the Mail ID from an email?

        You can use the following script in a Javascript Task. require("validation.js"); task.parameters = { MailVariable: { description: "The variable containing IMailInfo mail item.", category: "Settings", type: { id: "variable", variableTypes: "object" }, ...
      • How can I get the Mail ID from an email?

        You can use the following script in a Javascript Task. require("validation.js"); task.parameters = { MailVariable: { description: "The variable containing IMailInfo mail item.", category: "Settings", type: { id: "variable", variableTypes: "object" }, ...