How to send emails - InfoPath Dev
in

InfoPath Dev

How to send emails

Last post 08-22-2005 10:13 AM by Agni Jonnalagadda. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-11-2005 09:08 AM

    • buzzby
    • Top 200 Contributor
    • Joined on 07-11-2005
    • United Kingdom
    • Posts 60

    How to send emails

    Hi

    this is my first post so please be kind.

    I am trying to get infopath to send an email to an email address within a text field with a set message. I want this to happen when i click on a button.

    Thanks in advance with help
  • 07-11-2005 06:23 PM In reply to

    Hi Buzzby and welcome to the forum!
    This is easy to do. You need to go to Data Connection. In the Designer, go to Tools->Data Connections and click Add. Select Submit data and click Next. Select "As an e-mail message" and click next. A dialog will appear that has lines for To:, Cc:, Bcc:, Subject:, Intro, and form attachment. Click on the "fx" button next to the To: line and click Insert Field or Group. Select the Field from your main data source. Click OK, and specify others if you want. Click Next and Finish. Note: the field must be a valid e-mail address.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 07-12-2005 08:56 AM In reply to

    • buzzby
    • Top 200 Contributor
    • Joined on 07-11-2005
    • United Kingdom
    • Posts 60
    Hi

    thanks for the response. I have tried that but have some problems. I have 3 different emails i want to send when i click on 3 different buttons. With your method it only allows me to send 1 email.

    Can anyone give me the code that the data connection generates?
  • 07-12-2005 09:42 AM In reply to

    Here is the code to send an email via code
    EmailAdapter oEmail = (EmailAdapter)thisXDocument.DataAdapters["Email Submit"];
    oEmail.To = "[email protected]; [email protected]";
    oEmail.CC = "[email protected]";
    oEmail.Subject = "subject";
    oEmail.Intro = "Intro";
    oEmail.Submit();

    Note: Above code is in c#

    Agni
    InfoPathDev India
  • 08-22-2005 05:17 AM In reply to

    I've tried using the code to programatically send an email but I get the following error message:

    System.Runtime.InteropServices.COMException
    An item with the following index does not exist in the collection: Email Submit

    What am I doing wrong?
  • 08-22-2005 10:13 AM In reply to

    Did you create an email dataconnection called "Email Submit"?

    Agni
    InfoPath Dev India
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.