Archive: http://www.houseoffusion.com/lists.cfm/link=i:4:166614
---
The from has to be a valid email address. So I would check that
(download IsEmail from cflib.org):

<cfset siteEmail = "[EMAIL PROTECTED]">
<cfif NOT(Len(form.email) AND IsEmail(form.email))>
  <cfset form.email = variables.siteEmail>
</cfif>
<cfmail to="#form.CompanyEmail#"
        cc="#variables.siteEmail#"
        from="#form.Email# "
        subject="leads #form.CategoryText# Lead">
.....

I don't like iif() (it is usually slower than cfif and certainly more
complicated)

Pascal

PS prefix your variables !!!!!! (I assumed they were form vars, but I
may be wrong)

> -----Original Message-----
> From: Stevo Vee [mailto:[EMAIL PROTECTED]
> Sent: maandag 14 juni 2004 17:55
> To: CF-Talk
> Subject: cfmail problem
>
> Please Help. I am changing some forms and actions on my
> website. I have a lead subscription website and currently the
> lead emails that go to my subscribing companies have my
> websites email as the sent and reply email with the customers
> in the form.  I am changing to have the potential customers
> as the from and reply email now which I have acomplished.
> HOWEVER, now if the customer does not have an email the lead
> gets lost in cyber space. How can I make add a rule that if
> the customer has no email and only phone that it at least
> goes to me or my subcribing companies using perhaps my
> websites email acting as a default?? Below is the current
> code: Your help or advice would be greatly appreciated. Thanks.
>
> <cfmail to="#CompanyEmail#" cc="[EMAIL PROTECTED]"
> from="#Email# "
> subject="leads #CategoryText# Lead">#CategoryText#
>
> I have tried the following but it still did not work:
> CFIF trim(Email) EQ "">
>     <CFSET Email = "my company email">
> </CFIF>
>
> <cfmail to="#CompanyEmail#" cc="my company email" from="#Email# "
> subject="leads #CategoryText# Lead">#CategoryText# <cfif
> CategoryID IS 2>Company Name: #FORM.CompanyName#</cfif>
>
> FROM="#iif(email EQ '',DE('my company email'),email)#"
>
> Try that too.  I didn't test it...it might need to be  
> #iif(email EQ '',DE('my company email'),DE(email))#
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to