Home: Perl Programming Help: Beginner:
sendmail pdf file



jake
Deleted

Apr 17, 2000, 3:51 AM


Views: 899
sendmail pdf file

I am a newbie with perl 5.19 running on NT. In response to a web form, I can attach a txt file to an email. however, a pdf doesn't work. It arrives corrupted.
I am using Matt's script called formhandler which shows sending pdf as an example.
Is the problem with file formats that may have changed since the script was written? The form field value is mime: /path/path/filename.pdf


Cure
User

Apr 18, 2000, 8:19 PM


Views: 899
Re: sendmail pdf file

  #!/usr/bin/perl
use MIME::Lite;

# Create a new message:
$msg = new MIME::Lite
From =>'me@myhost.com',
To =>'you@yourhost.com',
Cc =>'some@other.com, some@more.com',
Subject =>'A message with 2 parts...',
Type =>'TEXT',


attach $msg
Type =>'TEXT',
Path =>'hi.pdf',
Filename =>'hi.pdf';


Send a message:

# Send in the "best" way (the default is to use "sendmail"):
$msg->send;




Cure

[This message has been edited by Cure (edited 04-18-2000).]