sangee...@gmail.com
unread,Nov 26, 2008, 12:51:46 AM11/26/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Perl Mail::Sendmail
When I am trying to use sendmail, and attach a file with it, for some
reason the attachment in the email has the full path of the file as
the name of the file.
So if my file is /tmp/abc.txt, when i attach this file, the name of
the file comes as /tmp/abc.txt. I would like the name to be something
else, like only abc.txt, and not the entire path.
Here is the code that I have at my end:
$file="/tmp/abc.txt";
$fileName="abc/txt";
if ($isFileAttached)
{
open (F, $file) || print LOGFILE "Failed to read $file: $!\n";
binmode F; undef $/;
$mail{body} = encode_base64(<F>);
close F;
}
$message
$boundary
Content-Type: application/$attachmentType; name="$file"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="$fileName"
Even though i have named the filename paramter as $fileName which is
abc.txt, it shows up as the entire path..