Send email by code using button in a repeating table

Hi
I have got a repeating table with textboxA, 1 people group textbox and a button. What I want is, when the button is clicked, an email should go out to the person's account selected in the people/group textbox with the contents of the textboxA value.
How do I do that in infopath, I  tried the below code just to see if the email was going out, but I was getting a permission error. 
MailMessage MailMsg = new MailMessage();
MailMsg.Body = "This is a test message and currently logged in user is " + System.Environment.UserName;
MessageBox.Show("This is a test message and currently logged in user is " + System.Environment.UserName);
//CTRL65_5_Clicked.Enabled = false;
MailMsg.From = new MailAddress("[email protected]");
MailMsg.To.Add("[email protected]");
MailMsg.Subject = "InfoPath Test Message";
SmtpClient server = new SmtpClient("test.smtp.com");
server.Send(MailMsg);

Hello,
First make your form as full trust from form options and verify if you get any permission issue or not.
Go to "File", then "Form Option", click on "Security Level" und clear the checkbox next to "Automatically determine security level" and instead select "Full Trust".
Later you need to follow below link to send email to selected user of person picker field.
http://blogs.msdn.com/b/infopath/archive/2006/04/05/569338.aspx?PageIndex=4
Let us know your result
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help

Similar Messages

  • Sending email to user using the notification template in OIM 11g

    Hi all
    I have created a Notification Template using web console in OIM 11g.
    Iam able to access the contents from notification template in my java code.
    But iam not able to find the correct api's to send email to user using the notification template
    (like tcEmailNotificationUtil using this class we can connect to email template created in design console and creating IT resourse we can send email to user using the method sendEmail).
    Waiting for your help and pointers
    Thanks and Regards
    Bipin patil

    Thanks GP!.
    But i have the same doubt here.
    "The Notification Event is defined through a XML file that must be loaded into MDS database." - in which path and in what name it should be.
    Because under /metadata/iam-features-notification, i couldnt see any event Xml present. I thought atleast we could see the existing OOB notification template's event xml files.
    Please let me know if you are aware.
    Thanks,
    Amudha

  • Sending an ESC code using the serial port

    I have a motor control aplication that requires sending an ESC character using the serial port. LabView has several built-in functions (end of line, line return, etc.) but I just do not know how to send this particular code using the serial port. Any ideas?

    The hex code for ESC character is 1b, Try writing it in a 8 bit unsigned number and then change that byte to charachter using labview function "byte Array to string". In this way you can pass this charachter.

  • I cannot send emails with pics using the stock email app on my new Droid Turbo, it holds them in the Outbox and won't send even if I move to Inbox and resend

    I cannot send emails with pics using the stock email app on my new Droid Turbo, it holds them in the Outbox and won't send even if I move to Inbox and resend

    First check to make sure you have data turned on and not just Wi-Fi. From reading your question you seem to be saying e mail is working just not attached photos. What size are the photos as some HD photos can't be sent. Your camera may be set at a very high picture size and you can go to settings and lower the size and that may solve your mailing problem.

  • I can't send emails through Yahoo using Firefox. Already contacted Yahoo and they don't know why it's happening.

    I can't send emails through Yahoo using Firefox. Already contacted Yahoo and they don't know why it's happening.
    == This happened ==
    Every time Firefox opened
    == a month agao

    I also cannot send email through Yahoo using Firefox 3.6.8. I can receive emails and surf the web just fine. I have also contacted Yahoo and have gotten no where.

  • Code to Use a button to send email in Java using NetBeans 4.1

    I am trying to use a JButton in Java to send an email to another recipient. I am relatively new to Java. Could someone send me the code?

    [url http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274]Sending email from your java applications for idiots who do not know how to search

  • Send email from SAP using SMTP-AUTH

    Dear all,
    I would like to send email from SAP to external SMTP server using authenticated method.
    Can I set up this scenario with SAPConnect?
    Or are there any other methods to set up this scenario?
    Thanks, Regards,
    Fendhy

    Hi,
    You dont need anu authentication to be set :
    Just follow below steps :
    Simple steps to do the SMTP configuration :
    1. Use transaction SCOT
    3. Double Click on SMTP
    4. You will get a window and fill in description
    5. Tick the "Node in use" box
    6. Enter the hostname of the email exchange server
    7. Mail port will be 25
    8. Click on the button next to Internet called "Set"
    9. You will get another window, in the "address area" box, enter *
    10. Click the green check button to exit the second window
    11. Click the green check button to exit the main window
    12. From top menu: Settings -> Default Domain
    13. in the small box that appears enter the domain name which is the last part after the @ sign. The domain name would be company.com
    14. You need to define a job to process the email, from top menu: View -> Jobs
    15. From top menu: Job -> Create
    16. Enter a name
    17. Click on "INT" in the list then "Schedule job" button
    18. Enter start date and time, then click on "Schedule Periodically" button
    19. Enter something like every 10 minutes.
    20. the configuration is now complete. To test it, you need to have an email defined in your user id properties. Use SU01 for that.
    21. Use transaction SO00
    22. Put Title, and text in the body, then enter your email address below, the recepient type would be "internet address"
    23. After a maximum of 10 minutes you should get the email address.
    Regards,
    Nirmal.K

  • [b]How to Send Email Through Developer using Micrsoft Outlook[/b]

    Here is the Code to Send Email From Developer 2000 using Microsoft Outlook(Note :- Outlook should be configured)
    Steps:-
    1. First Add the Wrapper Procedures for Outlook Express from the OLE Importer Utility such as
    · OUTLOOK_ATTACHMENT
    · OUTLOOK_MAILITEM
    PROCEDURE SENDEMAIL(to_Person varchar2,subject varchar2,body varchar2) IS
    EmailApp ole2.obj_type;
    EmailItem Ole2.Obj _Type;
    EmailAttachment Ole2.Obj_Type;
    EmailAttach ole2. obj_Type;
    aa number(5):=1;
    begin
    EmailApp:=ole2.create_obj('outlook.application');
    EmailItem:=ole2. create_obj('outlook.mail item');
    EmailAttachment:=ole2.create_obj('outlook.Attachment');
    EmailItem:=Outlook_Application.create Item(Email App,Outlook_Constants.olmailitem);
    EmailAttach:=Outlook_Mail Item.Attachment(Email Item);
    Add attachment From Block
    Go_block('BLK_ATTACHMENT');
    FIRST_RECORD;
    LOOP
    Email Attachment:=OutLook_Attachment.ole_Add(EmailAttach,;BLK_ATTACHMENTS.attach,1,AA,ISPNAME);
    AA:=AA+1;EXIT WHEN:SYSTEM.LAST_RECORD='TRUE';
    NEXT_RECORD;
    END LOOP;
    Outlook_mailitem.OLE_to(EmailItem,TO_PERSON);
    Outlook_mailitem.subject(emailitem,SUBJECT);
    Outlook_mailitem.Ole_body(emailitem,MAIL.BODY);
    Outlook_mailitem.send(emailItem);
    End;

    Here is the Code to Send Email From Developer 2000 using Microsoft Outlook(Note :- Outlook should be configured)
    Steps:-
    1. First Add the Wrapper Procedures for Outlook Express from the OLE Importer Utility such as
    · OUTLOOK_ATTACHMENT
    · OUTLOOK_MAILITEM
    PROCEDURE SENDEMAIL(to_Person varchar2,subject varchar2,body varchar2) IS
    EmailApp ole2.obj_type;
    EmailItem Ole2.Obj _Type;
    EmailAttachment Ole2.Obj_Type;
    EmailAttach ole2. obj_Type;
    aa number(5):=1;
    begin
    EmailApp:=ole2.create_obj('outlook.application');
    EmailItem:=ole2. create_obj('outlook.mail item');
    EmailAttachment:=ole2.create_obj('outlook.Attachment');
    EmailItem:=Outlook_Application.create Item(Email App,Outlook_Constants.olmailitem);
    EmailAttach:=Outlook_Mail Item.Attachment(Email Item);
    Add attachment From Block
    Go_block('BLK_ATTACHMENT');
    FIRST_RECORD;
    LOOP
    Email Attachment:=OutLook_Attachment.ole_Add(EmailAttach,;BLK_ATTACHMENTS.attach,1,AA,ISPNAME);
    AA:=AA+1;EXIT WHEN:SYSTEM.LAST_RECORD='TRUE';
    NEXT_RECORD;
    END LOOP;
    Outlook_mailitem.OLE_to(EmailItem,TO_PERSON);
    Outlook_mailitem.subject(emailitem,SUBJECT);
    Outlook_mailitem.Ole_body(emailitem,MAIL.BODY);
    Outlook_mailitem.send(emailItem);
    End;

  • Outlook 2013 crashing when sending email Exception code 0xc0000602 MSO.dll error

    Two are three times a week Outlook crashes when sending email with the following error
    Log Name:      Application
    Source:        Application Error
    Date:          15/01/2015 10:00:58
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      ********.***.local
    Description:
    Faulting application name: OUTLOOK.EXE, version: 15.0.4667.1000, time stamp: 0x543d3698
    Faulting module name: mso.dll, version: 15.0.4675.1002, time stamp: 0x5474349b
    Exception code: 0xc0000602
    Fault offset: 0x011b1687
    Faulting process id: 0x11dc
    Faulting application start time: 0x01d030a6e4aa1ee7
    Faulting application path: C:\Program Files (x86)\Microsoft Office\Office15\OUTLOOK.EXE
    Faulting module path: C:\Program Files (x86)\Common Files\Microsoft Shared\Office15\mso.dll
    Report Id: 66ad29a2-9c9d-11e4-b53c-082e5f1727fc
    Event Xml:
    <Event xmlns
      <System>
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <Level>2</Level>
        <Task>100</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2015-01-15T10:00:58.000000000Z" />
        <EventRecordID>10015</EventRecordID>
        <Channel>Application</Channel>
        <Computer>Events-HP8200.ICI.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>OUTLOOK.EXE</Data>
        <Data>15.0.4667.1000</Data>
        <Data>543d3698</Data>
        <Data>mso.dll</Data>
        <Data>15.0.4675.1002</Data>
        <Data>5474349b</Data>
        <Data>c0000602</Data>
        <Data>011b1687</Data>
        <Data>11dc</Data>
        <Data>01d030a6e4aa1ee7</Data>
        <Data>C:\Program Files (x86)\Microsoft Office\Office15\OUTLOOK.EXE</Data>
        <Data>C:\Program Files (x86)\Common Files\Microsoft Shared\Office15\mso.dll</Data>
        <Data>66ad29a2-9c9d-11e4-b53c-082e5f1727fc</Data>
      </EventData>
    </Event>
    Any clues on a fix?

    Hi,
    Thanks for your question.
    This issue might occurs due to lots of reasons. Do you have a virus scanner installed which integrates itself with Outlook? If yes, please try to disable it, and then try again. You might opt to uninstall the virus scanner temporarily to make
    sure it will not interfere the testing.
    Also, lots of Office crash issues are caused by third-party add-ins. You might want to have a check and see if you have any integrated with your Outlook client which might cause the issue.
    Since the issue occurs randomly ("Two are three times a week"), Office
    Safe Mode will not be effective here, just manually disable all third-party add-ins in Outlook FILE>Options>Ass-Ins, use outlook for a period of time, then verify result.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Unable to send email from Mac using Outlook for Mac 2011

    I have a single user that cannot send email from the Mac after migrating to Exchange 2013 on-prem. I myself am on the same Exchange server and am using a Mac with Office 2011 and am able to send/receive emails without any issues.
    When the user sends an email it goes to the sent mail folder and syncs with the server and can be seen on a windows machine running any other version of Office (same in OWA). I've logged the user in on my Mac and blown away my profile and seeing the same issue.
    Not sure if this narrows my issue down to the Exchange server receiving the send request from a Mac or if it's some setting in Outlook on the Mac?
    I do not see anything in the logs on the server and have not seen any error son the Mac.
    Any thoughts as to where my issues is? 

    Hi,
    According to your description, I find that there is a single user cannot send email.
    I suggest using Outlook on Windows machine and sending emails via this single user to verify whether the emails can be sent.
    If the single user can send email via Outlook on Windows machine, it seems an issue on the Mac side.
    I suggest asking Outlook for Mac Forum for help so that we can get more professional suggestions.
    For your convenience:
    http://answers.microsoft.com/en-us/mac/forum/macoutlook?tab=Threads
    If can't send emails in Outlook, it seems an issue on the single user side.
    I suggest trying to access the single user's mailbox via OWA to verify whether the mailbox has been migrated completely.
    Thanks
    Mavis
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Mavis Huang
    TechNet Community Support

  • Can't Send Email from Iphone Using Pop Account

    I have check our host names, ports, user name, passwords etc (all the account mail settings are OK) for incoming and outgoing servers. I can receive email fine but can't send them back out through the outgoing server. I am using the identical settings that I used in my Treo (which sent out emails fine). Upon sending an email the error message I get on my iphone is: " The recipient [email protected] was rejected by the server." I've noticed that I can send an email to "myself" (from the iphone) and it will show up on the in my email box, but email sent to other addresses will generate the above message. I've noticed, too, that I have to keep resetting the "Authentication" to "Password" (under advance settings) because it mysteriously resets itself to "MD5 Challenge-Response". The setting should be set to "Password" however. We are using a FirstClass email system. Sending email via the iphone by way of .mac, yahoo and gmail works fine (no mysterious rest of the "Authorization" settings either) .
    It most me something obvious, but I can't see it.
    I would really appreciate some help.

    You might find this discussion helpful:
    http://discussions.apple.com/message.jspa?messageID=4976383#4976383

  • Cannot send email to companies using Office 365

    I have recently come into a problem with emailing companies that use Exchange Office 365.
    We have regular email contact with 2 companies and recently we are getting the following message when sending them email:
    From: Microsoft Outlook
    Sent: Friday, August 08, 2014 12:35 PM  To: Assist Program
    Subject: Undeliverable: Consumers Account No. ##########
    Delivery has failed to these recipients or groups:
     The server has tried to deliver this message, without success, and has stopped trying. Please try sending this message again.
    If the problem continues, contact your helpdesk.
    Diagnostic information for administrators:
    Generating server: ###.###on.local 
    consumeraffairs@####.###
    #550 4.4.7 QUEUE.Expired; message expired ##
    Original message headers:
    Received: from
    ###.###on.local ([fe80::2452:938f:6dd9:822b]) by  ###.###on.local
    Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.100.118] Content-Type: multipart/alternative;        
    boundary="_000_A53763D7745441418094A31C2B75645B02BF4D49ASUMPTIONSBSass_" MIME-Version: 1.
    We have:
    Windows Small Business Server 2011
    Exchange 2010
    Netgear Prosafe VPN fvs318
    I have talked to there tech teams and they said it never reaches their queue.  The only thing that both of them have changed is that they switched to hosted Exchange Office 365.  I'm trying to help out my church, so I am in no way knowledgeable
    in Exchange.  I have the firewall open to outgoing mail and emails we're going through until about a month ago.  Since both of them are no longer going through, I'm sure there is a setting on my end that is not allowing them.  Can anyone suggest
    where to look?
    Thanks.

    Hi,
    To narrow down this issue, please take your time to collect some information:
    Does this happen to message sent to an individual, to a domain, or to a network?
    Does it happen for messages sent to recipients within your organization, or to recipients at other domains?
    What do the SMTP protocol logs show when attempting to send the messages?
    Refer to:
    http://technet.microsoft.com/en-us/library/bb124531(v=exchg.141).aspx
    Try to stop and restart the Exchange Transport service to check this problem.
    Thanks.

  • Send email from workflow using a variable in the to field in SharePoint Online (Office 365)

    I have a simple sharepoint workflow that sends and email to users.  I know that the mail portion works because I can put a user's email address in the to: field and it sends fine.  If I use a string variable with the email address, I get a workflow
    error.
    Simple steps to repro for me:
    Create a new workflow in SPD  (I have tried a list workflow and site workflow)
    Create a workflow variable named email.
    Set the variable to an email address where the user is in the site
    Send email and do a variable lookup to the email variable just set.
    The workflow just hangs in this scenario
    I do get an error:
    Retrying last request. Next attempt scheduled in less than one minute. Details of last request: HTTP BadRequest to https://[tenant].sharepoint.com/_api/sp.utilities.utility.SendEmail
    Correlation Id: 568e9c68-ea75-d057-ab9f-d86f6cae3021 Instance Id: 9cc721a4-78e6-456f-812b-67351dfc9710
    The e-mail message cannot be sent. Make sure the e-mail has a valid recipient.
    Retry now

    Simple answer... When I used the variable, I marked it as a string.  There is an email address setting.

  • How can I send email from iPad using someone else's server

    I use the Netspace server but I'm visitng a friend and using her optusnet server for the Internet, however I am unable to send email, even though I can receive it

    Critters222-
    I assume Netspace is your Internet provider.  They may have their mail server set up to only work when you are accessing the server locally from their domain.  I suggest you contact Netspace and ask them what you need to do to send E-Mail to them from other domains.
    Have you been able to send E-Mail from other places?  If so, there might be a firewall problem in Optusnet.  In that case, they may be best able to advise you. 
    Fred
    Message was edited by: Fred*M.

  • SSRS unable to send email subscription notification using SendGrid from a VM/AZURE

    In SSRS (using a VM in AZURE) I configured eMail  to use SendGrid.
    When the subscription triggered I get the following error:
    Failure sending mail: Mailbox unavailable. The server response was: Cannot receive from specified address <[email protected]>: Unauthenticated senders not allowed
    I talked to SendGrid support and they say that you need to be authenticated (They provided a username and password when I registered) but I can't find the way to provide the credentials. I tried to insert them in the rsreportserver.config file but if I change
    SMTPAuthenticate to 1, to use the credentials, the email option doesn't show in the subscription setting form in SSRS (See below).
    <Configuration>
                        <RSEmailDPConfiguration>
                            <SMTPServer>smtp.sendgrid.net</SMTPServer>
                            <SMTPServerPort>
                            </SMTPServerPort>
                            <SMTPAccountName>
                            </SMTPAccountName>
                            <SMTPConnectionTimeout>
                            </SMTPConnectionTimeout>
                            <SMTPServerPickupDirectory>
                            </SMTPServerPickupDirectory>
                            <SMTPUseSSL>
                            </SMTPUseSSL>
                            <SendUsing>2</SendUsing>
                            <SMTPAuthenticate>2</SMTPAuthenticate>
                            <sendusername>[email protected]</sendusername>
                            <sendpassword>sw76929u5RabclB</sendpassword>
                            <From>[email protected]</From>
                            <EmbeddedRenderFormats>
                                <RenderingExtension>MHTML</RenderingExtension>
                            </EmbeddedRenderFormats>
                            <PrivilegedUserRenderFormats>
                            </PrivilegedUserRenderFormats>
                            <ExcludedRenderFormats>
                                <RenderingExtension>HTMLOWC</RenderingExtension>
                                <RenderingExtension>NULL</RenderingExtension>
                                <RenderingExtension>RGDI</RenderingExtension>
                            </ExcludedRenderFormats>
                            <SendEmailToUserAlias>False</SendEmailToUserAlias>
                            <DefaultHostName>
                            </DefaultHostName>
                            <PermittedHosts>
                            </PermittedHosts>
                        </RSEmailDPConfiguration>
                    </Configuration>
    Is there any other SMTP that I can use in a AZURE VM that will send email just using a valid email (I can do that in my internal SMTP)?
    Is there a way to provide the credentials?
    Thanks in advance!

    Hi SendGrid,
    According to your description, you want to use the SendGrid SMTP server for configuring email subscription. Now you have the problem on sending the credential to access the SendGrid SMTP server. Right?
    In Reporting Services, when configuring subscription, we need to specify a Windows domain user to run the Reporting Services. Definitely this domain user credential can't access the SendGrid SMTP server. In this scenario, we need to install the Local
    SMTP server and configure the SMTP virtual server. And we can put credential in Access Control. For detail steps, please refer to similar threads below:
    How to configure SSRS Report Subscriptions to use Gmail for GP  
    Using
    Google SMTP server (smtp.gmail.com) when configuring subscriptions unders SSRS 2008
    Reference:
    How to: Install and Configure SMTP Virtual Servers in IIS 6.0
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

Maybe you are looking for