Which worked great and would insert form variable values ($name in this example) into the email body. Now I'm trying to usesub send_email { open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n"; print MAIL "Content-type:text/html\n"; print MAIL "From: $from_email\n"; print MAIL "To: $to_email\n"; print MAIL "Subject: $attention Employment Application : $fields{'n +ame'}\n\n"; print MAIL <<to_the_end; <html> <head> <title>Human Resources : Application for Employment</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1 +"> </head> <body bgcolor="#FFFFFF" marginwidth="0" marginheight="0" class="margin +"> <table width="600" border="0"> <tr valign="top"> <td width="300"><font face="Arial, Helvetica, sans-serif" size="-1"><b +>Name:</b> <i>$name</i></font></td> </tr> </table> to_the_end close (MAIL); }
and instead of printing out the value of $name, it just prints $name literally. I've been reading all over the place and everything just points to using the $message variable for the email, but how do I build the $message variable with other variable values? Is there anything similar to the print <<to_the_end; functionality for MIME? TIAsub Email_Results{ my $message = ' <html> <head> <title>Human Resources : Application for Employment</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1 +"> </head> <body bgcolor="#FFFFFF" marginwidth="0" marginheight="0" class="margin +"> <table width="600" border="0"> <tr valign="top"> <td width="300"><font face="Arial, Helvetica, sans-serif" size="-1"><b +>Name:</b> <i>$name</i></font></td> </tr> </table> </body> </html>'; $msg = MIME::Lite->new(From => 'net-admin@someplace.org', To => 'decoraw@someplace.org', Subject => 'Trying to send attachment', Type => 'multipart/mixed'); $msg->attach(Type => 'text/html', Data => $message); $msg->attach(Type => 'application/octet-stream', Path => "$Directory/$File_Name", Filename => $File_Name ); $msg->send(); }
In reply to MIME::Lite $message construction with variables by hmbscully
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |