Thursday, December 17, 2009

coldfusion simple email script

Here is a simple Form email script for any generic form. I needed a quick generic email script for a few basic websites on a non coldfusion server to be able to send email through a cf server. So this script takes a form submission from another server and emails it to

. It does check the referers IP address to make sure its a valid request.



<cfset inet_address = CreateObject("java", "java.net.InetAddress")>
<cfset referer= replaceNocase(cgi.HTTP_REFERER,'http://','')/>
<cfset referer= listGetAt(referer,1,'/')/>

<cfset host_IP = listLast(inet_address.getByName(referer),'/')>
<!---required parameters --->
<cfparam name="form.mailfrom" />
<cfparam name="form.mailto" />
<cfparam name="form.mailsubject" />
<cfparam name="form.success" />


<!---check the remote IP address so spammers cant abuse it --->
<cfif host_IP eq "192.168.1.1">
<cfoutput>
<cfmail to="#form.mailto#" from="#form.mailfrom#" subject="form.mailsubject" type="html">

<cfloop collection ="#form#" item="thisAttribute">
#thisAttribute#:#form[thisAttribute]#<br>
</cfloop>
</cfmail>
</cfoutput>

<cflocation url="#form.success#"/>
<cfelse>

wrong ipaddress

</cfif>



I know I know this is not an ideal situation and is pretty insecure. Sometimes you just have to do as the client asks


Stumble Upon CodePyro

2 comments:

Benny said...

Obviously, you will find ceramic tag heuer replica sale that are arriving a growing number of colours, however typically, whole ceramic instances continue to be mainly obtainable in just dark or even whitened. Whilst much more fascinating colours hublot replica with ceramic such as azure, dark brown, red-colored, as well as lemon tend to be rolex replica sale getting obtainable, they are mainly limited by bezels and also the colours are rolex replica sale hard to obtain correct. Therefore, having the ability to provide a long lasting, high-quality situation color procedure ought to be very helpful with a individuals. The actual need to personalize rolex replica is actually growing, as well as I'm pleased to observe that the actual colours readily available for steel replica watches sale layer tend to be growing. At this time, Rau-Tech neglects to provide all of the colours from the range, however a lot more than simply dark can be obtained.

Zdeněk Šrámek said...

https://isocialhub.net/paypal-credit-card-generator/

Post a Comment