It doesn't work even I write the "file" as: 
file => "http://$ENV{'HTTP_HOST'}/Mail-Sender.zip" 

(I have put the file Mail-Sender.zip into the root folder of my apache web
server.)

But it can find the file and send the mail when I write it as: 
file => "d:/apache group/apache/htdocs/Mail-Sender.zip" 

really confused...

Anyone can help?

Xu, Qiang (XSSC SGP) wrote:
> Subject: RE: Mail::Sendmail module problem?
> 
> 
> Hi, Lakoduk:
> 
> Thanks for pointing out the help webpage. Now I can use Mail::Sender
> to send mails. But I have difficulties with attachments. I don't know
> why it always complains that the file can't be found. My script is:
> 
> -------------------------------------------
> use strict;
> use Mail::Sender;
> use CGI qw(:standard);
> 
> my $sender = new Mail::Sender {
>       smtp => 'my.smtp.server',
>       from => '[EMAIL PROTECTED]',
>       on_errors => undef
>       } or die "Can't create the Mail::Sender object:
> $Mail::Sender::Error\n";
> $sender->OpenMultipart({
>       to => '[EMAIL PROTECTED]',
>       subject => 'Hello, I\'ll come.'
>       }) or die "Can't open the message: $sender->{'error_msg'}\n";
> $sender->Body;
> $sender->SendEnc(<<'*ABC*');
> Here is a new module Mail::Sender.
> It provides an object based interface to sending SMTP mails.
> It uses a direct socket connection, so it doesn't need any additional
> program.
> 
> Enjoy, Jedi
> *ABC*
> $sender->Attach({
>       description => 'Perl module Mail::Sender.pm',
>       ctype => 'application/x-zip-encoded',
>       encoding => 'Base64',
>       disposition => 'attachment; filename="Mail-Sender.zip"; type="ZIP
> archive"',
>       file => "./Mail-Sender.zip"
>       });
> $sender->Close or die "Failed to send the message:
> $sender->{'error_msg'}\n";
> 
> print header(), start_html("Sendmail");
> print p("Mail sent successfully!\n");
> print end_html();
> 
> exit (0);
> -------------------------------------------
> 
> I put the file Mail-Sender.zip in the same folder as this script. The
> error is:
> 
> [Mon Sep 15 16:15:52 2003] [error] Failed to send the message: File
> "./Mail-Sender.zip" not found
> 
> Any idea on this issue?
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to