Solved

CFMail problem

Posted on 2006-07-21
9
386 Views
Last Modified: 2013-12-24
One of my forms on a website is not delivering results. The form submits fine. I have been over the code 100 times and can't find anything. All other forms on the site work.


<cfif trim(len(Email)) LT 1>
    You must provide an email address.<br>
    Use the back button in your browser to correct the problem.<br><br>
<cfabort>
</cfif>



<CFSET thisPath= ExpandPath("resumes/")>
<CFSET thisDirectory= GetDirectoryFromPath(thisPath)>

<cfif trim(len(resume)) GT 4>
<cffile
                        action="UPLOAD"
                        filefield="resume"
                        destination="#GetDirectoryFromPath(thisPath)#"
                        nameconflict="makeunique"
                        mode="777">
                        
                        
                  
cfif cffile.serverfileext EQ "exe">
               You are attempting to upload an executable file.<br><br>
                Please use the back button in the browser to upload a file that is not executable.


                        <cfabort>
</cfif>

<cfset resume='#File.ServerFile#'>
</cfif>


<cfmail to="#form.email#" from="#form.resumeemail#" subject="#form.subject#" type="html" bcc="caroline@advancedwebs.biz">

<cfif trim(len(form.resume)) GT 0>      
      <cfmailparam file="#GetDirectoryFromPath(thisPath)#/#resume#">
</cfif>

#form.subject# <br><br>
From job posting: #jobID#<br><br>
<cfloop index="thefield" list="#form.fieldnames#">
    <cfset fields="#thefield# = #evaluate(thefield)#">
    <CFIF #fields# contains "submit" or #fields# contains "required"
            OR #FIELDS# contains "recipient" or #fields# contains "subject"
            or #FIELDS# contains "redirect">

    <cfelse>
        #fields#<br>
    </cfif>
</cfloop>
</cfmail>
0
Comment
Question by:semerj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 7

Expert Comment

by:aseusainc
ID: 17158582
The code looks fine.  Any restrictions on your SMTP server that might be denying this?  Instead of <cfmail>ing this, just <cfoutput>all the values and make sure you are getting what you expect to be getting.
0
 

Author Comment

by:semerj
ID: 17158662
no. all the other forms on the site work.
0
 
LVL 7

Accepted Solution

by:
aseusainc earned 500 total points
ID: 17159323
check your cfmail.log and see if theres an entry for it.  let's see if it's even trying to email it.
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 1

Expert Comment

by:aescribens
ID: 17167485
I do see one small error in the code above...

You are missing the opening "<" in the following code:  cfif cffile.serverfileext EQ "exe">
0
 

Author Comment

by:semerj
ID: 17167531
Copy and paste error. It is in the actualo code on the page.
0
 
LVL 5

Expert Comment

by:mrigsby
ID: 17173446
One thought I have is that by default CFMail spools these emails and I have had problems in the past with this (Especially with attachments as they tend to be lower priority). One thing you can try is to set the spoolenable="no" in the CFmail tag and possibly specify the server,username and password parameters to test it and see if that makes a difference.
0
 
LVL 7

Expert Comment

by:aseusainc
ID: 17191380
Thanks for the points.  Guessing there was an issue with SMTP?  What was the final resolution to this, so that others might learn from it?
0
 

Author Comment

by:semerj
ID: 17192841
Kind of. Actually, I misnamed one of the form fields which resulted in the email field being blank and CF not sending the mail.
0
 
LVL 7

Expert Comment

by:aseusainc
ID: 17192870
Thanks for the follow up!
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
What You Need to Know when Searching for a Webhost Provider
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question