3 Replies Latest reply on Nov 11, 2009 5:20 AM by walter_m8242

    Sending an Email via ColdFusion as a Service leads to ActionScript-Error "Server is undefined to setup the connection"

    walter_m8242

      Hi,

      Ben Forta shows in his video "ColdFusion9 exposed as Flex Services" how to send an Email using ColdFusion as a Service.
      I tried out this example with Flashbuilder4 Beta2 but I got the following ActionSript-Error:

       

      Error: Server is undefined to setup the connection
          at coldfusion.service::BasicService/initializeConnection()[D:\p4\depot\ColdFusion\cf_main\to ols\AIRIntegration\Services\src\coldfusion\service\BasicService.as:278]
          at coldfusion.service::BasicService/call()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegrati on\Services\src\coldfusion\service\BasicService.as:226]
          at coldfusion.service.mxml::Mail/execute()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegrati on\Services\src\coldfusion\service\mxml\Mail.as:370]
          at CFaaS/button1_clickHandler()[C:\Dokumente und Einstellungen\walter\Adobe Flash Builder Beta 2\CFaaS\src\CFaaS.mxml:18]
          at CFaaS/___CFaaS_Button1_click()[C:\Dokumente und Einstellungen\walter\Adobe Flash Builder Beta 2\CFaaS\src\CFaaS.mxml:93]

       

      Who has an idea what to do?

       

      Thanks in advance,
      Walter

        • 1. Re: Sending an Email via ColdFusion as a Service leads to ActionScript-Error "Server is undefined to setup the connection"
          Balaji Sridhar

          Hi,

           

          We tried this out and it works like a charm

           

          Actually even we hit the issue you have mentioned but on further investigation we could get things working.

           

          Please follow these settings, we are not sure if you have done all of these:

           

          a) In CF9 administrator, under Mail section please type your server name, username and password. Check the '

          checkbox and click 'Submit Changes'. Make sure you get the message 'Connection Verification Successful'.

           

          b) Under Security-> 'User Manager' section in CF9 administration,  add an user using 'Add User' with the following info:

          username, password, confirm password , check both RDS and administrative access and add 'Exposed Services' by selecting the required services.

          eg: Mail Service and click 'Add User'.

           

          c) Go to 'Security->Allow IP Address in CF9 administrator and enter your IP address and say 'Add'.

           

          d) After add the following tag in addition to CF:Mail,

          <cf:Config  cfServer="" cfPort="8501" servicePassword="" serviceUserName="" />(the values entered here should be same as the ones configured under 'Add User' and 'Allow IP address' section).

           

          Please find attached the mxml file (TestCF.mxml) which has the Flex code.

           

          Also, add the 'CFService.swc' into your project. Go to  Project->Flex Build Path->Add SWC and point to D:\ColdFusionCentaur\wwwroot\CFIDE\scripts\air (subject to CF9 installed location).

           

          Please try the workflow by following these steps and let us know if things work fine

           

          Thanks,

          Balaji

          http://balajisridhar.wordpress.com

          1 person found this helpful
          • 2. Re: Sending an Email via ColdFusion as a Service leads to ActionScript-Error "Server is undefined to setup the connection"
            Balaji Sridhar Level 2

            Looks like the attachment did not get through.

             

            Please use the following Flex code as sample:

             

            <cf:Mail to="{to1.text}" from="{from1.text}"  subject="Test" content="{myContent.text}" type="html" id="cfmail"  result="cfmail_resultHandler(event)" />
                <mx:VBox>
                    <mx:HBox>
                        <mx:Label text="From"/>
                        <mx:TextInput id="from1" />
                     </mx:HBox>
                    <mx:HBox>
                        <mx:Label text="To" width="33"/>
                        <mx:TextInput id="to1" />
                    </mx:HBox>
                    <mx:RichTextEditor id="myContent">
                       
                    </mx:RichTextEditor>   
                    <mx:Button id="myButton" label="Send" click="cfmail.execute()"/>
                   
                </mx:VBox>

            1 person found this helpful
            • 3. Re: Sending an Email via ColdFusion as a Service leads to ActionScript-Error "Server is undefined to setup the connection"
              walter_m8242 Level 1

              Hi,

               

              Super!
              I followed the steps of your workflow and now it works like a charm too.

              Thank you very much for your detailed help.

               

              Walter