Perl and CGI

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentPerl and CGI

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old November 22nd, 2012, 09:02 AM
marko marko is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 marko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 53 sec
Reputation Power: 0
Merging two contact form fields

Good morning all...

I'm pretty new to cgi so please bear with me.. I have been tasked with incorporating a contact us form in our community theater's existing site. At some later date that same form may have to update mailchimp, but baby steps for now. One of the things that I would like to do is to add a prefix to the subject of the mails that are generated so that submissions could be easily identified by the theater admin (who also receives non-form based email at with same email address.)

I have pasted the mail routine below. On the form, there is also a hidden field called 'site' which contains the url of the site. Is there a way to combine the subject field from the form along with the hidden field so the that mail's subject field takes on the format of: site - subject ?

sub mail_it
{
my $theMail = "To: $RECIPIENT\n";
my $tmp = $fields{'from'};
if( defined($fields{'sendername'}) && $fields{'sendername'} ne "" ) {
$tmp = "\"$fields{'sendername'}\" <$tmp>";
}
$theMail .= "From: $tmp\n";
if( defined($fields{'sendername'}) && $fields{'carboncopy'} eq 'on' ) {
$theMail .= "Cc: $tmp\n";
}
$theMail .= "Subject: $fields{'subject'}\n";
$theMail .= "Return-Path: <$fields{'from'}>\n";
$theMail .= xHeaders() ."\n"; # end of headers

$theMail .= "First Name: $fields{'sendername'}\n\n";
$theMail .= "Last Name: $fields{'lastname'}\n\n";
$theMail .= "Email address: $fields{'from'}\n\n";
$theMail .= "Telephone: $fields{'telephone'}\n\n";
$theMail .= "Subject: $fields{'subject'}\n\n";
$theMail .= "Mesage: $fields{'message'}\n\n";

open(MZT,"|$MAIL_PROGRAM -t") || die "Unable to send mail: $^E";
print MZT $theMail;
close(MZT);

return $theMail;
}

Many thanks in advance,
Marko

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentPerl and CGI > Merging two contact form fields


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap