Can't send email using cfc and <cfmail>

I have a flash movie calling this cfc. The insert the record into the database part works OK, but the <cfmail> does not. What's wrong?

<cffunction name="InsertNewComment" access="remote" returntype="string" hint="Add new comment">
            <!--- Define required parameters --->
            <cfargument name="FirstName" type="string" required="yes">
            <cfargument name="LastName"  type="string" required="yes">
            <cfargument name="Email"     type="string" required="yes">
            <cfargument name="Message"   type="string" required="yes">


            <!--- Insert new record into the Database --->

            <cfquery  datasource="boxoroxnet" username="boxoroxnet" password="Qm4ba27d">
            INSERT INTO email_ (FirstName, LastName, Email, Date, Message)
            VALUES('#FirstName#','#LastName#','#Email#',#Now()#,'#Message#')
                 </cfquery>
                  
           <cfmail
            from="info@lfoo.com"
            to="foo@foo.com"
            subject="Message">

      content here
            
      </cfmail>
       
     <!--- Specify result as string --->
      <cfset result="Thank you! You'll receive a response from fooFoo shortly.">
      <!--- Return result of the function --->
      <cfreturn result>
      </cffunction>
kabookisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PluckaCommented:
Well, since you haven't specified any servers. Is your mail server setup in ColdFusion administrator and does it verify?
0
PluckaCommented:
Also try checking the ColdFusion logs, as if this is getting an error you wont see it, but will see it in the logs.

C:\ColdFusion8\logs\
0
kabookisAuthor Commented:
Mail is set up in CF Admin. Other templates on this site are able to send email.

When I run the code

   <cfmail
            from="info@lfoo.com"
            to="foo@foo.com"
            subject="Message">

      content here
           
      </cfmail>

in a separate cf page (mail_test.cfm) in the same directory as the cfc, the email gets sent.

Using mail_test.cfm, the CF Admin mailsent.log reports Mail"Message sent from info@foo.com To; foo@foo.com was successfully sent using ..."

When I copy and paste the same code into the function, no email is sent.
mail.sent reports nothing, and mail.log reports no errors. The database insert always works, however.



0
kabookisAuthor Commented:
I figured it out the email problem, but I still don't get why it now works.  I changed the Flash Publish settings to "Access network only" and the entire cfc works. The form field info is inserted into the database, and the email is sent.


Why would having the Publish settings set at "Access local files only" allow a DB insert but not a <cfmail> tag?





0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.