PDA

View Full Version : FormMail.cgi send HTML email help


Crusher
11-25-2006, 07:47 PM
hello to all, I communicate with you since they are the community big and believe that they are the only ones that vain me to be able to help....
Sincerely I have or urgent disadvantage with FormMail. CGI, I need that the mail what is sent I sent in format HTML and not as text ... I tried everything but I cannot achieve it, this is for a page of my work and I have it what to finish before Friday that comes but puts in game on my work.... HELPME!!!!!
The company uses only CGI because of it I cannot do anything in PHP and this limits me very much. I tried placing Content Type and all that but he(she) writes it to me as text in the mail does not take this value. Sincerely already not that to do, for one month I am with this and not or manage to extract forward ... please I wait for your help... Here I leave them the part of my FormMail where he(she) writes the mail to have if they can say to me where I place the content type or that it is what exists what to modify... From already thank you very much to all....
--------------------------------------------------------------------------
f ($Config{'pgp'} =~ /\w/)
{ open (MAIL, "|/etc/support/pgpencrypt $Config{'pgp'}"); }
elsif ($Config{'pgp_key'} =~ /\w/)
{ open (MAIL, "|/etc/support/pgpencrypt $Config{'pgp_key'}"); }
else
{ open(MAIL,"|$mailprog -t"); }

$Config{'subject'} = remove_newlines_and_other_nasties($Config{'subject'});
$Config{'realname'} = remove_newlines_and_other_nasties($Config{'realname'});

# addresses are now validated before they get this far
#$Config{'email'} = validated_email_syntax($Config{'email'});
#$Config{'recipient'} = validated_email_syntax($Config{'recipient'});
#$Config{'ccrecipient'} = validated_email_syntax($Config{'ccrecipient'});
#$Config{'bccrecipient'} = validated_email_syntax($Config{'bccrecipient'});

print MAIL "To: $Config{'recipient'}\n";
if ($Config{'ccrecipient'})
{ print MAIL "CC: $Config{'ccrecipient'}\n"; }
if ($Config{'bccrecipient'})
{ print MAIL "BCC: $Config{'bccrecipient'}\n"; }
print MAIL "From: $Config{'email'} ($Config{'realname'})\n";


# Check for Message Subject 159

if ($Config{'subject'}) { print MAIL "Subject: $Config{'realname'} $Config{'subject'}\n\n" }
else { print MAIL "Subject: WWW Form Submission\n\n" }

print MAIL "Below is the result of your feedback form. It was submitted by\n";
print MAIL "$Config{'realname'} ($Config{'email'}) on $date\n";
print MAIL "-" x 75 . "\n\n";

if (@Print_Config) {
foreach $print_config (@Print_Config) {
if ($Config{$print_config}) {
print MAIL "$print_config: $Config{$print_config}\n\n";
}
}
}

# Sort alphabetically if specified: #
if ($Config{'sort'} eq 'alphabetic') {
foreach $field (sort keys %Form) {

# If the field has a value or the print blank fields option #
# is turned on, print out the form field and value. #
if ($Config{'print_blank_fields'} || $Form{$field} ||
$Form{$field} eq '0') {
print MAIL "$field: $Form{$field}\n\n";
}
}
}

# If a sort order is specified, sort the form fields based on that. #
elsif ($Config{'sort'} =~ /^order:.*,.*/) {

# Remove extraneous line breaks and spaces, remove the order: #
# directive and split the sort fields into an array. #
$Config{'sort'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
$Config{'sort'} =~ s/(\s+)?\n+(\s+)?//g;
$Config{'sort'} =~ s/order://;
@sorted_fields = split(/,/, $Config{'sort'});

# For each sorted field, if it has a value or the print blank #
# fields option is turned on print the form field and value. #
foreach $sorted_field (@sorted_fields) {
if ($Config{'print_blank_fields'} || $Form{$sorted_field} ||
$Form{$sorted_field} eq '0') {
print MAIL "$sorted_field: $Form{$sorted_field}\n\n";
}
}
}

# Otherwise, default to the order in which the fields were sent. #
else {

# For each form field, if it has a value or the print blank #
# fields option is turned on print the form field and value. #
foreach $field (@Field_Order) {
if ($Config{'print_blank_fields'} || $Form{$field} ||
$Form{$field} eq '0') {
print MAIL "$field: $Form{$field}\n\n";
}
}
}

print MAIL "-" x 75 . "\n\n";

# Send any specified Environment Variables to recipient. #
foreach $env_report (@Env_Report) {
if ($ENV{$env_report}) {
print MAIL "$env_report: $ENV{$env_report}\n";
}
}

close (MAIL);
}

Crusher
11-27-2006, 12:32 AM
upup up