Solved

CFMail problem

Posted on 2006-07-21
9
385 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
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Firewall Speed Issue 6 72
Problem to go to page 12 110
Why is my Splunk Web URL not working? 2 83
DNS @ Naked Domain Record 5 111
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 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