WebVirtue Software Solutions is a global IT solutions and services provider. We provide Offshore Software Development - Website Design, Web Application Development Services, Software Outsourcing and Offshore Outsourcing, to Clients Globally.

   
 
 

  Previous Posts

 

  Archives

 

Friday, January 30, 2009


Image manipulation capabilities in ColdFusion 8

Not much people are using Coldfusion these days but i see lot of potential in Coldfusion 8 ... i came across the need of image manipulation and its then i found out the capabilities of new cfimage tag and image-related functions. The cfimage tag introduces lot of new ways to manipulate images in ColdFusion without having to install any third-party image manipulation tags or Java classes.

Here is an example how you can use the cfimage tag to create CAPTCHA (Completely Automated Public Turing Test to Tell Computers and Humans Apart) graphics in the browser:

<cfset captchatext="hello">
<cfimage width="140" height="40" difficulty="low" text="#captchaText#" action="captcha">

Here you see cfimage tag with the action property set to captcha, followed by the text property set to the captchaText variable: this is the text that will be displayed in the generated CAPTCHA image. The difficulty property has three settings, low, medium, and high, which affects the degree to which the text is obscured, to make it harder for a computer to distinguish characters. The last two properties, width and height, set the graphic’s display dimensions.

Tuesday, January 13, 2009


Perl Mail Messages Handling

Recently we were working on Mail Messages handling and we choose to do it using Perl. Perl has lot of modules that can be of great help .... the granddaddy of these modules is Mail::Internet, originally created by Graham Barr and now maintained by Mark Overmeer. This module offers a constructor that takes either an array of lines or a filehandle, reads a message, and returns a Mail::Internet object representing the message.

You can get From, Reply-To, To, Subject using get() method. Reading and editing the body is done through the body method.

I've not said anything about MIME yet. Mail::Internet is reasonably handy for simple tasks, but it doesn't handle MIME at all. So we used another module as Email::MIME.

Here is the full code:

require Mail::Internet;
require Mail::Address;
require Email::MIME;
$mail = Mail::Internet->new( \*STDIN );
my $sender = $mail->get('Reply-To') || $mail->get('From');
my $to = $mail->get('To');
my $subject = $mail->get('Subject');
my $body = $mail->as_string();
my $email = Email::MIME->new($body);
my $part_body = ($email->subparts())[0]->body;