in reply to Re: Format text problem
in thread Format text problem
sub send_confirmation_email { my $text = format_email_text(30,50, "Player Name", $player, "Parent's Name", $parent, "Member ID", $memberid, "Email Address", $email, "Camp Date(s)", $dates, "Camp Event", $event, "Street", $street, "City", $city, "State", $state, "Zip Code", $zip, "Payment Method", $payment, "Message", $message); my %mail = ( From => "info\@anywhwere.com", To => $email, Subject => "Registration", Message => "" ); my $page; $mail{Message} = <<EOF; This is the information you submitted. $text EOF sendmail (%mail) or $page .= p (escapeHTML ("Oops, failure sending mail to $mai +l{To}")); return (defined ($page) ? $page : ""); }
sub format_email_text { my ($name, $val, $out, $nd, $vd); $nd = shift; $vd = shift; while ($name = shift) { $val = shift; $out .= sprintf('%-'.$nd.'s %-'.$vd.'s', "$name:", $val) . "\n +"; } return $out; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Format text problem
by nobull (Friar) on Apr 03, 2005 at 12:46 UTC |