Jon Hall wrote:
> Ok then I will... ;)
> 
> Never one to turn down a challenge, but having no clue what I was
> doing my first thought was to try brute force...and it worked.
> 
> So here are the steps for anyone interested.
> Download Javamail 1.3 from Sun's site.
> Shut down Cold Fusion.
> Make backup of CFusionMX\runtime\lib\jrun.jar.
> Make backup of CFusionMX\runtime\lib\jrun.jar.
> Read the above two lines again.
> Using Jar archive manager of choice (I used WinRar), and open both
> jrun.jar and the mail.jar file from the Javamail 1.3 download.
> In the mail.jar file, navigate the the javax\mail directory and copy
> it to the clipboard.
> Int the jrun.jar file, navigate to the javax directory and paste
> files. WinRar will do it's thing and write out a file called
> something like "zias.j40". That's the new and improved jrun.jar.
> Rename it to jrun.jar, and start up ColdFusion again.
> 
> Congratulations, you now have Javamail 1.3, probably voided all
> warranties, and gained access to the nifty validate() method!
> 
> Some example code:
> 
> <cfset objJavamail = createObject("java", "javax.mail.internet.InternetAddress")>
> <cfdump var="#objJavamail#">
> 
> <cfset emailAddress = "inv@[EMAIL PROTECTED]">
> <cfset objJavamail.init(emailAddress, true)>
> 
> <cftry>
>         <cfset objJavamail.validate()>
>         <cfcatch type="javax.mail.internet.AddressException">
>                 <cfoutput>#cfcatch.message#</cfoutput>
>         </cfcatch>
> </cftry>
> <cfoutput>
> #objJavamail.getAddress()#
> </cfoutput>
> 
> This doesn't catch everything a tweaked regex catches, but it does
> catch a lot, and it gives a very specific english error message. It's
> also very fast. There are a lot of other handy methods in the InternetAddress
> class too. You can make it try and correct an invalid email address
> even. Seems to do a pretty good job at it.
> Link to docs:
> http://java.sun.com/products/javamail/1.3/docs/javadocs/index.html
> 
> I'm starting to think this MX stuff is pretty cool. There is a lot of
> untapped power built into Java that I can't wait to see exposed in CF.
> 

You can also place the Javamail 1.3 jar file first in the classpath of 
coldfusion. This will amke sure it finds the new version first. This is 
easier, and will work consistent with updates

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to