<% my $FORM = $Request->Form(); foreach my $key ( keys %{$FORM} ) { ${$FORM}{$key} =~ s/'/`/sg; ${$FORM}{$key} = substr(${$FORM}{$key},0,155) unless $key eq 'address'; ${$FORM}{phone} = substr(${$FORM}{phone},0,20); } my $ERROR = ''; my $MESSAGE = ''; if ( ${$FORM}{submit} ) { ${$FORM}{newsletter} = '1' if ${$FORM}{newsletter}; ${$FORM}{newsletter} = '0' if !${$FORM}{newsletter}; if ( ${$FORM}{firstname} && ${$FORM}{lastname} && ${$FORM}{job} && ${$FORM}{company} && ${$FORM}{email} && ${$FORM}{phone} && ${$FORM}{address} && ${$FORM}{postcode} && ${$FORM}{town} && ${$FORM}{country} ) { if ( valid_address(${$FORM}{email}) ) { my $dbh = dbcon(); $dbh->do(qq[ insert into members (firstname,lastname,job,company,email,phone,address,postcode,town,country,newsletter,site,registration_date,demos,business_session,technical_session) values ('${$FORM}{firstname}','${$FORM}{lastname}','${$FORM}{job}','${$FORM}{company}','${$FORM}{email}','${$FORM}{phone}','${$FORM}{address}','${$FORM}{postcode}','${$FORM}{town}','${$FORM}{country}',${$FORM}{newsletter},'${$FORM}{site}',now(),'${$FORM}{demos}','${$FORM}{business_session}','${$FORM}{technical_session}') ]) || die $dbh->errstr; $dbh->disconnect; ${$FORM}{saved} = 1; $MESSAGE = 'Thank you for registering to attend the VCCF 2012'; use Mail::Sender; my $sender = new Mail::Sender; $sender->OpenMultipart({ smtp => '127.0.0.1', from => 'info@virtualizationforum.gr', to => ${$FORM}{email}, encoding => "Quoted-printable", multipart=> 'alternative', subject => 'Registration Confirmation - Virtualization & Cloud Computing Forum 2012', }) or die Mail::Sender::Error; $sender->Part( ctype => "text/plain", disposition => "inline" ) || die Mail::Sender::Error; $sender->SendEnc("Registration Confirmation - Virtualization & Cloud Computing Forum 2012") || die Mail::Sender::Error; $sender->Body('utf-8',0,'text/html'); $sender->SendEnc(qq[ Thank you for registering to attend the Virtualization & Cloud Computing Forum 2012, that will take place on Wednesday, 14th of March 2012 at the Athinais Cultural Center. The final agenda of the event will be posted online at http://www.virtualizationforum.gr/agenda.html To receive updates regarding the forum, join the Virtualization & Cloud Computing Forum Group on Linkedin ]) || die Mail::Sender::Error; $sender->Close; } else { $ERROR = 'Your email is not valid!'; } } else { $ERROR = 'All fields are required!'; } } %> VIRTUALIZATION & CLOUD COMPUTING FORUM 2012