Sending email attachments

I use the following (working) script to generate and send an email:

chdir $createPath;
local($filename) = "tempFile.tmp";
open(TFILE,">$filename");
print TFILE "To: $test_email\n";
print TFILE "Subject: Test\n";
print TFILE "From: $regName <$email>\n\n";
print TFILE "Value: $cookieValue\n";
print TFILE "Client: $talValue\n";
close (TFILE);

if ($test_email !~ / /) { `$mailPath $test_email < $filename`; }
unlink("$filename");

How do I send an attachment with this email?
--
Ed Jay (remove 'M' to respond by email)
Ed Jay [ So, 14 Januar 2007 18:26 ] [ ID #1595046 ]

Re: Sending email attachments

On 01/14/2007 11:26 AM, Ed Jay wrote:
> I use the following (working) script to generate and send an email:
>
> chdir $createPath;
> local($filename) = "tempFile.tmp";
> open(TFILE,">$filename");
> print TFILE "To: $test_email\n";
> print TFILE "Subject: Test\n";
> print TFILE "From: $regName <$email>\n\n";
> print TFILE "Value: $cookieValue\n";
> print TFILE "Client: $talValue\n";
> close (TFILE);
>
> if ($test_email !~ / /) { `$mailPath $test_email < $filename`; }
> unlink("$filename");
>
> How do I send an attachment with this email?

It seems that you can create e-mails with attachments using MIME::Tools.

On my Debian system, there is a program called "mpack" (written by
Robert Leslie) that also claims to do this.

--
Windows Vista and your freedom in conflict:
http://techdirt.com/articles/20061019/102225.shtml
paduille.4060.mumia.w[1] [ So, 14 Januar 2007 21:20 ] [ ID #1595047 ]

Re: Sending email attachments

"Ed Jay" <edMbj [at] aes-intl.com> wrote in message
news:oppkq2hevpvpbm5ruu1nfhv597v80duv4m [at] 4ax.com...
>I use the following (working) script to generate and send an email:
>
> chdir $createPath;
> local($filename) = "tempFile.tmp";
> open(TFILE,">$filename");
> print TFILE "To: $test_email\n";
> print TFILE "Subject: Test\n";
> print TFILE "From: $regName <$email>\n\n";
> print TFILE "Value: $cookieValue\n";
> print TFILE "Client: $talValue\n";
> close (TFILE);
>
> if ($test_email !~ / /) { `$mailPath $test_email < $filename`; }
> unlink("$filename");
>
> How do I send an attachment with this email?

Probably the most popular module for this would be MIME::Lite



--
Posted via a free Usenet account from http://www.teranews.com
Tintin [ Mo, 15 Januar 2007 10:05 ] [ ID #1596144 ]

Re: Sending email attachments

Mumia W. (NOSPAM) scribed:

>On 01/14/2007 11:26 AM, Ed Jay wrote:
>> I use the following (working) script to generate and send an email:
>>
>> chdir $createPath;
>> local($filename) = "tempFile.tmp";
>> open(TFILE,">$filename");
>> print TFILE "To: $test_email\n";
>> print TFILE "Subject: Test\n";
>> print TFILE "From: $regName <$email>\n\n";
>> print TFILE "Value: $cookieValue\n";
>> print TFILE "Client: $talValue\n";
>> close (TFILE);
>>
>> if ($test_email !~ / /) { `$mailPath $test_email < $filename`; }
>> unlink("$filename");
>>
>> How do I send an attachment with this email?
>
>It seems that you can create e-mails with attachments using MIME::Tools.
>
>On my Debian system, there is a program called "mpack" (written by
>Robert Leslie) that also claims to do this.

Thanks much for the reply and information.
--
Ed Jay (remove 'M' to respond by email)
Ed Jay [ Mo, 15 Januar 2007 16:14 ] [ ID #1596145 ]

Re: Sending email attachments

Tintin scribed:

>
>"Ed Jay" <edMbj [at] aes-intl.com> wrote in message
>news:oppkq2hevpvpbm5ruu1nfhv597v80duv4m [at] 4ax.com...
>>I use the following (working) script to generate and send an email:
>>
>> chdir $createPath;
>> local($filename) = "tempFile.tmp";
>> open(TFILE,">$filename");
>> print TFILE "To: $test_email\n";
>> print TFILE "Subject: Test\n";
>> print TFILE "From: $regName <$email>\n\n";
>> print TFILE "Value: $cookieValue\n";
>> print TFILE "Client: $talValue\n";
>> close (TFILE);
>>
>> if ($test_email !~ / /) { `$mailPath $test_email < $filename`; }
>> unlink("$filename");
>>
>> How do I send an attachment with this email?
>
>Probably the most popular module for this would be MIME::Lite

Thank you.
--
Ed Jay (remove 'M' to respond by email)
Ed Jay [ Mo, 15 Januar 2007 16:14 ] [ ID #1596146 ]
Perl » alt.perl » Sending email attachments

Vorheriges Thema: newbie struggling to protect ebook using PERL
Nächstes Thema: Iterator special variable $_