Episerver xforms event AfterSubmitPostedData not firing


First of all it can be validation problem, but if not, it is probably the smtp settings that is missing.

This is usually in your global.asax.cs

FormControl.AfterSubmitPostedData += new SaveFormDataEventHandler(FormControl_AfterSubmitPostedData);

But it will never trigger

You must have the smtp setting in web.config

In your local environment you can skip the smtp outgoing mails and instead have the mail as a static file on your disk.

You can also set the xforms button to just "Save in database", and it will not check for the smtp setting.


  <system.net>
    <mailSettings>
      <!--<smtp deliveryMethod="PickupDirectoryFromIis" />-->
      <smtp deliveryMethod="SpecifiedPickupDirectory">
        <specifiedPickupDirectory pickupDirectoryLocation="C:\dev\SpecifiedPickupDirectory" />        
      </smtp>
      <!-- Common usage is to use other network existing mail server other than
                 IIS Virtual SMTP Server. 
                 In such cases use the commented settings below with your server
                 location and authentication credentials.
                 -->
      <!--<smtp from="localhost" deliveryMethod="Network">
                <network host="localhost" port="25" userName="" password="" defaultCredentials="false" />
      </smtp>-->
    </mailSettings>
  </system.net>

1 kommentar: