Adding Cc:, Bcc:, and Introduction to email - InfoPath Dev
in

InfoPath Dev

Adding Cc:, Bcc:, and Introduction to email

Last post 02-17-2007 02:29 PM by cchenning. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-16-2007 05:12 AM

    Adding Cc:, Bcc:, and Introduction to email

    I have the code below for my "Send eMail" button. It works, but I would like to add a Cc:, Bcc, and Introduction. I would also like to add a hard-coded email address to the beginning of the "To:"

    Why can't I just change

    oEnvelope.To = rgRecipients.join(" ;");

        to

    oEnvelope.Cc = rgRecipients.join(" ;");

    What is the secret to making this work?


    ----------------------------------------

    function SendEmailBtn::OnClick(oEvent)
    {
    createEmail();
    }
    function createEmail()
    {
    var xmlContributors = XDocument.DOM.selectNodes("/iss:issue/iss:contributors/iss:contributor");
    var xmlContributor;
    var xmlTitle = XDocument.DOM.selectSingleNode("/iss:issue/iss:title");
    var rgRecipients = new Array();

    while (xmlContributor = xmlContributors.nextNode())
    rgRecipients.push(getNodeValue(xmlContributor.selectSingleNode("iss:emailAddressPrimary")));

    try
    {
    var oEnvelope = XDocument.View.Window.MailEnvelope;

    oEnvelope.To = rgRecipients.join(" ;");
    oEnvelope.Subject = getNodeValue(xmlTitle);
    oEnvelope.Visible = true;
    }
    catch (ex)
    {
    XDocument.UI.Alert(ex.description);
    }
    }
  • 02-16-2007 06:05 AM In reply to

    • shekar
    • Not Ranked
      Male
    • Joined on 07-26-2006
    • India
    • Posts 22

    Re: Adding Cc:, Bcc:, and Introduction to email

    Hi cchenning

    Yes you can send CC and BCC but you can not send
    Introduction with the above code.

    With Infopath DataConnections you can send Introduction.
    Hope the following code will help you.

    var EmailAdapter = XDocument.DataAdapters["Email"];
    EmailAdapter.To = "mailId";
    EmailAdapter.BCC ="mailId";
    EmailAdapter.CC ="mailId";
    EmailAdapter.Subject ="SubjectText";
    EmailAdapter.Intro ="IntroductionText";
    EmailAdapter.Submit();
    Shekar
    http://www.ggktech.com
  • 02-16-2007 11:47 AM In reply to

    Re: Adding Cc:, Bcc:, and Introduction to email

    OK, I'll accept that I cannot add Introduction, I'll even forget the Bcc:.

    I would still like to add a Cc: and a hard-coded email address to the beginning of the "To:".

    How would I go about doing this using the above code as a basis?
  • 02-16-2007 10:45 PM In reply to

    • shekar
    • Not Ranked
      Male
    • Joined on 07-26-2006
    • India
    • Posts 22

    Re: Adding Cc:, Bcc:, and Introduction to email

    Hi cchenning
    var mailid ="";
    for(index=0;index<rgrecpient.length;index++)
    {
    rgrecpient[index]= rgrecpient[index].concat(";");
    mailid = mailid + rgrecpient[index];
    }

    //CC and BCC's
    oEnvelope.CC = mailid;
    oEnvelope.BCC = mailid;

    Hope this helps you.
    Shekar
    http://www.ggktech.com
  • 02-17-2007 02:29 PM In reply to

    Re: Adding Cc:, Bcc:, and Introduction to email

    Shaker,
    Thank you so much, great answer!!!

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.