CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
code generated email body

 



emelin
stranger

Feb 21, 2001, 1:13 AM

Post #1 of 4 (284 views)
code generated email body Can't Post

This is probably just me being stupid, but I have a problem! I'm trying to use some code in the body of an email, but it doesn't work! I have verified that the code works outside the email stuff.

It looks like this:

open (MAIL, "|/usr/sbin/sendmail -t") || die "Unable to open mail file $!\n";
print MAIL <<END_OF_MAIL;
To: $email
From: $ref
Subject: Test

foreach $key (keys %form) {
print "$form{$key};"
}

END_OF_MAIL

What am I doing wrong?

The email looks like the following:

foreach (keys %form) {
print "";
}

It won't execute the code and it ignores the variable!?

This is my first time trying to send email with perl/cgi... help appreciated!



muinatit
Deleted

Feb 21, 2001, 3:31 AM

Post #2 of 4 (280 views)
Re: code generated email body [In reply to] Can't Post


Code
open (MAIL, "|/usr/sbin/sendmail -t") || die $!; 
print MAIL "To: $email\n";
print MAIL "From: $ref\n";
print MAIL "Subject: Test\n\n";

foreach $key (keys %form) {
print MAIL $form{$key};
}

close MAIL;

Jeffrey "muinatit" Lamoureux
muinatit@hotpop.com


emelin
stranger

Feb 21, 2001, 3:52 AM

Post #3 of 4 (279 views)
Re: code generated email body [In reply to] Can't Post

Thanks a lot! It is working!!




muinatit
Deleted

Feb 21, 2001, 4:02 AM

Post #4 of 4 (277 views)
Re: code generated email body [In reply to] Can't Post

Not a problem. :) You just can't have code in between one of those

print <<EOF;

EOF

things.

Jeffrey "muinatit" Lamoureux
muinatit@hotpop.com

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives