I'm not exactly sure which parts to substitute in your code. Here is my code, which has partially worked, as I've noted, but not as I wish. Earlier in the script, I am opening filehandles, and writing them to .txt files to create the attachments (i.e.):
open (ORDER_DATA, ">$order_dir/temp_order.txt") || die "Can't open $or
+der_dir/temp_order.txt!\n";
select (ORDER_DATA);
&print_form;
select (STDOUT);
close (ORDER_DATA);
Then, here is the mime::lite section:
### Create the multipart "container":
$msg = MIME::Lite->new(
From =>$FORM{"email"},
To =>$recipient,
Subject =>"STI Document Order $FORM{ORDER_NUMBER}
+",
Type =>'multipart/mixed');
$msg->attach(Path =>"$order_dir/temp_order.txt");
### Add the attachment:
$msg->attach(Path =>"$order_dir/temp_order_attach.txt",
Disposition =>'attachment');
$text = $msg->as_string;
$msg->send($mailprog);
Can you tell me the best way to adapt the (ARGV[0], and $fh parts of your code to mine, so I can make this work using my .txt files?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.