[28897] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 141 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 15 14:14:44 2007

Date: Thu, 15 Feb 2007 11:14:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 15 Feb 2007     Volume: 11 Number: 141

Today's topics:
        Sending a local attachment via email form <edMbj@aes-intl.com>
    Re: Sending a local attachment via email form <yankeeinexile@gmail.com>
    Re: Sending a local attachment via email form <john.swilting@wanadoo.fr>
    Re: Sending a local attachment via email form <edMbj@aes-intl.com>
    Re: Sending a local attachment via email form <edMbj@aes-intl.com>
    Re: Sending a local attachment via email form <null@no_spam.com>
    Re: Sending a local attachment via email form <john.swilting@wanadoo.fr>
    Re: Sending a local attachment via email form <edMbj@aes-intl.com>
    Re: Sending a local attachment via email form <john.swilting@wanadoo.fr>
    Re: Sending a local attachment via email form <edMbj@aes-intl.com>
    Re: Sending a local attachment via email form <edMbj@aes-intl.com>
    Re: Sending a local attachment via email form <john.swilting@wanadoo.fr>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 15 Feb 2007 09:50:49 -0800
From: Ed Jay <edMbj@aes-intl.com>
Subject: Sending a local attachment via email form
Message-Id: <m779t2l4m2v59f09be15ppd9h4rmh8t0d2@4ax.com>

I know how to send an attachment that I create with a server-side email
routine (MIME::Lite). It requires me to have the attachment in a known
location on my host server. 

Can anyone provide a hint regarding a site visitor sending a local
attachment using a Perl script fed with an HTML email form?
-- 
Ed Jay (remove 'M' to respond by email)


------------------------------

Date: 15 Feb 2007 12:06:50 -0600
From: Lawrence Statton XE2/N1GAK <yankeeinexile@gmail.com>
Subject: Re: Sending a local attachment via email form
Message-Id: <87bqjvmh1h.fsf@gmail.com>

Ed Jay <edMbj@aes-intl.com> writes:
> I know how to send an attachment that I create with a server-side email
> routine (MIME::Lite). It requires me to have the attachment in a known
> location on my host server. 
> 

It *CAN*, but that is not a requirement.  Re-read the documentation.

Here's a hint to get you started

MIME::Lite->new(
		From => 'William Clinton <prsident@whitehouse.gov>',
		To => 'Ed Jay <edMbj@aes-intl.com>',
		Subject => 'Free Clue',
		Type => 'application/octet-stream',
		Data => $some_big_binary_blob_of_data
	       )->send;
-- 
	Lawrence Statton - lawrenabae@abaluon.abaom s/aba/c/g
Computer  software  consists of  only  two  components: ones  and
zeros, in roughly equal proportions.   All that is required is to
place them into the correct order.


------------------------------

Date: Thu, 15 Feb 2007 19:23:26 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: Sending a local attachment via email form
Message-Id: <45d4a512$0$27415$ba4acef3@news.orange.fr>

Lawrence Statton XE2/N1GAK wrote:

> Ed Jay <edMbj@aes-intl.com> writes:
>> I know how to send an attachment that I create with a server-side email
>> routine (MIME::Lite). It requires me to have the attachment in a known
>> location on my host server.
>> 
> 
> It *CAN*, but that is not a requirement.  Re-read the documentation.
> 
> Here's a hint to get you started
> 
> MIME::Lite->new(
> From => 'William Clinton <prsident@whitehouse.gov>',
> To => 'Ed Jay <edMbj@aes-intl.com>',
> Subject => 'Free Clue',
> Type => 'application/octet-stream',
> Data => $some_big_binary_blob_of_data
> )->send;
sub SEND_MAIL{
    my($attachement,$nom,$prenom,$mail,$body) = @_;
    
    my $message_body .= $nom;
    $message_body .= "\n";
    $message_body .= $prenom;
    $message_body .= "\n";
    $message_body .= $body;
    
    my $mime_msg = MIME::Lite->new(
        From => $from_adress,
        To => $mail,
        Subject => 'contact',
        Type => 'TEXT',
        Data => $message_body,
        ) or die "error creating MIME body: $!\n";
    if( $attachement eq ''){
        $mime_msg->send;
        }else{
            my $attachement_upload = '/var/www/html/upload/';
            $attachement_upload .= $attachement;
            $mime_msg->attach(
                Type => 'image/gif',
                Path => $attachement_upload,
                Filename => 'attachement.gif'
                ) or die "error attaching image: $!\n";
            $mime_msg->send;        
            }
}

and use CGI::UploadEasy
nice code
correct


------------------------------

Date: Thu, 15 Feb 2007 10:30:38 -0800
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Sending a local attachment via email form
Message-Id: <7j99t29mffn95qc6db6mi2mr1fj8970fj4@4ax.com>

Lawrence Statton XE2/N1GAK scribed:

>Ed Jay <edMbj@aes-intl.com> writes:
>> I know how to send an attachment that I create with a server-side email
>> routine (MIME::Lite). It requires me to have the attachment in a known
>> location on my host server. 
>> 
>
>It *CAN*, but that is not a requirement.  Re-read the documentation.
>
>Here's a hint to get you started
>
>MIME::Lite->new(
>		From => 'William Clinton <prsident@whitehouse.gov>',
Only GWB spells president as you did. ;-)

>		To => 'Ed Jay <edMbj@aes-intl.com>',
>		Subject => 'Free Clue',
>		Type => 'application/octet-stream',
>		Data => $some_big_binary_blob_of_data
>	       )->send;

Thanks for the hint, Lawrence.

Ed (N6EJ)


------------------------------

Date: Thu, 15 Feb 2007 10:32:10 -0800
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Sending a local attachment via email form
Message-Id: <hm99t2l9g5bn26a4fhrsuq0h9pvqth41a7@4ax.com>

john.swilting scribed:

>Lawrence Statton XE2/N1GAK wrote:
>
>> Ed Jay <edMbj@aes-intl.com> writes:
>>> I know how to send an attachment that I create with a server-side email
>>> routine (MIME::Lite). It requires me to have the attachment in a known
>>> location on my host server.
>>> 
>> 
>> It *CAN*, but that is not a requirement.  Re-read the documentation.
>> 
>> Here's a hint to get you started
>> 
>> MIME::Lite->new(
>> From => 'William Clinton <prsident@whitehouse.gov>',
>> To => 'Ed Jay <edMbj@aes-intl.com>',
>> Subject => 'Free Clue',
>> Type => 'application/octet-stream',
>> Data => $some_big_binary_blob_of_data
>> )->send;
>sub SEND_MAIL{
>    my($attachement,$nom,$prenom,$mail,$body) = @_;
>    
>    my $message_body .= $nom;
>    $message_body .= "\n";
>    $message_body .= $prenom;
>    $message_body .= "\n";
>    $message_body .= $body;
>    
>    my $mime_msg = MIME::Lite->new(
>        From => $from_adress,
>        To => $mail,
>        Subject => 'contact',
>        Type => 'TEXT',
>        Data => $message_body,
>        ) or die "error creating MIME body: $!\n";
>    if( $attachement eq ''){
>        $mime_msg->send;
>        }else{
>            my $attachement_upload = '/var/www/html/upload/';
>            $attachement_upload .= $attachement;
>            $mime_msg->attach(
>                Type => 'image/gif',
>                Path => $attachement_upload,
>                Filename => 'attachement.gif'
>                ) or die "error attaching image: $!\n";
>            $mime_msg->send;        
>            }
>}
>
>and use CGI::UploadEasy
>nice code
>correct

Thanks very much, John. 
-- 
Ed Jay (remove 'M' to respond by email)


------------------------------

Date: Thu, 15 Feb 2007 12:03:40 -0600
From: Todd <null@no_spam.com>
Subject: Re: Sending a local attachment via email form
Message-Id: <er279s$hn8$1@home.itg.ti.com>

Ed Jay wrote:
> I know how to send an attachment that I create with a server-side email
> routine (MIME::Lite). It requires me to have the attachment in a known
> location on my host server. 
> 
> Can anyone provide a hint regarding a site visitor sending a local
> attachment using a Perl script fed with an HTML email form?

When they upload the file you know where it is on your server.

Todd


------------------------------

Date: Thu, 15 Feb 2007 19:37:43 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: Sending a local attachment via email form
Message-Id: <45d4a86b$0$27379$ba4acef3@news.orange.fr>

Ed Jay wrote:

> john.swilting scribed:
> 
>>Lawrence Statton XE2/N1GAK wrote:
>>
>>> Ed Jay <edMbj@aes-intl.com> writes:
>>>> I know how to send an attachment that I create with a server-side email
>>>> routine (MIME::Lite). It requires me to have the attachment in a known
>>>> location on my host server.
>>>> 
>>> 
>>> It *CAN*, but that is not a requirement.  Re-read the documentation.
>>> 
>>> Here's a hint to get you started
>>> 
>>> MIME::Lite->new(
>>> From => 'William Clinton <prsident@whitehouse.gov>',
>>> To => 'Ed Jay <edMbj@aes-intl.com>',
>>> Subject => 'Free Clue',
>>> Type => 'application/octet-stream',
>>> Data => $some_big_binary_blob_of_data
>>> )->send;
>>sub SEND_MAIL{
>>    my($attachement,$nom,$prenom,$mail,$body) = @_;
>>    
>>    my $message_body .= $nom;
>>    $message_body .= "\n";
>>    $message_body .= $prenom;
>>    $message_body .= "\n";
>>    $message_body .= $body;
>>    
>>    my $mime_msg = MIME::Lite->new(
>>        From => $from_adress,
>>        To => $mail,
>>        Subject => 'contact',
>>        Type => 'TEXT',
>>        Data => $message_body,
>>        ) or die "error creating MIME body: $!\n";
>>    if( $attachement eq ''){
>>        $mime_msg->send;
>>        }else{
>>            my $attachement_upload = '/var/www/html/upload/';
>>            $attachement_upload .= $attachement;
>>            $mime_msg->attach(
>>                Type => 'image/gif',
>>                Path => $attachement_upload,
>>                Filename => 'attachement.gif'
>>                ) or die "error attaching image: $!\n";
>>            $mime_msg->send;
>>            }
>>}
>>
>>and use CGI::UploadEasy
>>nice code
>>correct
> 
> Thanks very much, John.
in French I am French


------------------------------

Date: Thu, 15 Feb 2007 10:46:33 -0800
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Sending a local attachment via email form
Message-Id: <cda9t2loqadndn8emgnu86q6q2ogagh1fi@4ax.com>

john.swilting scribed:

>Ed Jay wrote:
>
>> john.swilting scribed:
>> 
>>>Lawrence Statton XE2/N1GAK wrote:
>>>
>>>> Ed Jay <edMbj@aes-intl.com> writes:
>>>>> I know how to send an attachment that I create with a server-side email
>>>>> routine (MIME::Lite). It requires me to have the attachment in a known
>>>>> location on my host server.
>>>>> 
>>>> 
>>>> It *CAN*, but that is not a requirement.  Re-read the documentation.
>>>> 
>>>> Here's a hint to get you started
>>>> 
>>>> MIME::Lite->new(
>>>> From => 'William Clinton <prsident@whitehouse.gov>',
>>>> To => 'Ed Jay <edMbj@aes-intl.com>',
>>>> Subject => 'Free Clue',
>>>> Type => 'application/octet-stream',
>>>> Data => $some_big_binary_blob_of_data
>>>> )->send;
>>>sub SEND_MAIL{
>>>    my($attachement,$nom,$prenom,$mail,$body) = @_;
>>>    
>>>    my $message_body .= $nom;
>>>    $message_body .= "\n";
>>>    $message_body .= $prenom;
>>>    $message_body .= "\n";
>>>    $message_body .= $body;
>>>    
>>>    my $mime_msg = MIME::Lite->new(
>>>        From => $from_adress,
>>>        To => $mail,
>>>        Subject => 'contact',
>>>        Type => 'TEXT',
>>>        Data => $message_body,
>>>        ) or die "error creating MIME body: $!\n";
>>>    if( $attachement eq ''){
>>>        $mime_msg->send;
>>>        }else{
>>>            my $attachement_upload = '/var/www/html/upload/';
>>>            $attachement_upload .= $attachement;
>>>            $mime_msg->attach(
>>>                Type => 'image/gif',
>>>                Path => $attachement_upload,
>>>                Filename => 'attachement.gif'
>>>                ) or die "error attaching image: $!\n";
>>>            $mime_msg->send;
>>>            }
>>>}
>>>
>>>and use CGI::UploadEasy
>>>nice code
>>>correct
>> 
>> Thanks very much, John.
>in French I am French

Oui! Je suis très désolé, John. J'ai habité une fois en Strasbourgh, donc
j'aurais dû savoir mieux. Encore, merci beaucoup.  :-))
-- 
Ed Jay (remove 'M' to respond by email)


------------------------------

Date: Thu, 15 Feb 2007 19:54:51 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: Sending a local attachment via email form
Message-Id: <45d4ac6f$0$27414$ba4acef3@news.orange.fr>

Ed Jay wrote:

> john.swilting scribed:
> 
>>Ed Jay wrote:
>>
>>> john.swilting scribed:
>>> 
>>>>Lawrence Statton XE2/N1GAK wrote:
>>>>
>>>>> Ed Jay <edMbj@aes-intl.com> writes:
>>>>>> I know how to send an attachment that I create with a server-side
>>>>>> email routine (MIME::Lite). It requires me to have the attachment in
>>>>>> a known location on my host server.
>>>>>> 
>>>>> 
>>>>> It *CAN*, but that is not a requirement.  Re-read the documentation.
>>>>> 
>>>>> Here's a hint to get you started
>>>>> 
>>>>> MIME::Lite->new(
>>>>> From => 'William Clinton <prsident@whitehouse.gov>',
>>>>> To => 'Ed Jay <edMbj@aes-intl.com>',
>>>>> Subject => 'Free Clue',
>>>>> Type => 'application/octet-stream',
>>>>> Data => $some_big_binary_blob_of_data
>>>>> )->send;
>>>>sub SEND_MAIL{
>>>>    my($attachement,$nom,$prenom,$mail,$body) = @_;
>>>>    
>>>>    my $message_body .= $nom;
>>>>    $message_body .= "\n";
>>>>    $message_body .= $prenom;
>>>>    $message_body .= "\n";
>>>>    $message_body .= $body;
>>>>    
>>>>    my $mime_msg = MIME::Lite->new(
>>>>        From => $from_adress,
>>>>        To => $mail,
>>>>        Subject => 'contact',
>>>>        Type => 'TEXT',
>>>>        Data => $message_body,
>>>>        ) or die "error creating MIME body: $!\n";
>>>>    if( $attachement eq ''){
>>>>        $mime_msg->send;
>>>>        }else{
>>>>            my $attachement_upload = '/var/www/html/upload/';
>>>>            $attachement_upload .= $attachement;
>>>>            $mime_msg->attach(
>>>>                Type => 'image/gif',
>>>>                Path => $attachement_upload,
>>>>                Filename => 'attachement.gif'
>>>>                ) or die "error attaching image: $!\n";
>>>>            $mime_msg->send;
>>>>            }
>>>>}
>>>>
>>>>and use CGI::UploadEasy
>>>>nice code
>>>>correct
>>> 
>>> Thanks very much, John.
>>in French I am French
> 
> Oui! Je suis très désolé, John. J'ai habité une fois en Strasbourgh, donc
> j'aurais dû savoir mieux. Encore, merci beaucoup.  :-))
c formidable 
merci



------------------------------

Date: Thu, 15 Feb 2007 11:03:01 -0800
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Sending a local attachment via email form
Message-Id: <8hb9t2ppgnjo7g8r73qheotsk5btsno43s@4ax.com>

Todd scribed:

>Ed Jay wrote:
>> I know how to send an attachment that I create with a server-side email
>> routine (MIME::Lite). It requires me to have the attachment in a known
>> location on my host server. 
>> 
>> Can anyone provide a hint regarding a site visitor sending a local
>> attachment using a Perl script fed with an HTML email form?
>
>When they upload the file you know where it is on your server.
>
Thanks, Todd. I'm a newbie at Perl, but somewhat adept at javascript, where
we can't tamper with the user's files. Uploading never occurred to me. 
-- 
Ed Jay (remove 'M' to respond by email)


------------------------------

Date: Thu, 15 Feb 2007 11:05:27 -0800
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Sending a local attachment via email form
Message-Id: <3mb9t2p4h03n7cibaiv6st7qlbodruhjml@4ax.com>

john.swilting scribed:

>Ed Jay wrote:
>
>> john.swilting scribed:
>> 
>>>Ed Jay wrote:
>>>
>>>> john.swilting scribed:
>>>> 
>>>>>Lawrence Statton XE2/N1GAK wrote:
>>>>>
>>>>>> Ed Jay <edMbj@aes-intl.com> writes:
>>>>>>> I know how to send an attachment that I create with a server-side
>>>>>>> email routine (MIME::Lite). It requires me to have the attachment in
>>>>>>> a known location on my host server.
>>>>>>> 
>>>>>> 
>>>>>> It *CAN*, but that is not a requirement.  Re-read the documentation.
>>>>>> 
>>>>>> Here's a hint to get you started
>>>>>> 
>>>>>> MIME::Lite->new(
>>>>>> From => 'William Clinton <prsident@whitehouse.gov>',
>>>>>> To => 'Ed Jay <edMbj@aes-intl.com>',
>>>>>> Subject => 'Free Clue',
>>>>>> Type => 'application/octet-stream',
>>>>>> Data => $some_big_binary_blob_of_data
>>>>>> )->send;
>>>>>sub SEND_MAIL{
>>>>>    my($attachement,$nom,$prenom,$mail,$body) = @_;
>>>>>    
>>>>>    my $message_body .= $nom;
>>>>>    $message_body .= "\n";
>>>>>    $message_body .= $prenom;
>>>>>    $message_body .= "\n";
>>>>>    $message_body .= $body;
>>>>>    
>>>>>    my $mime_msg = MIME::Lite->new(
>>>>>        From => $from_adress,
>>>>>        To => $mail,
>>>>>        Subject => 'contact',
>>>>>        Type => 'TEXT',
>>>>>        Data => $message_body,
>>>>>        ) or die "error creating MIME body: $!\n";
>>>>>    if( $attachement eq ''){
>>>>>        $mime_msg->send;
>>>>>        }else{
>>>>>            my $attachement_upload = '/var/www/html/upload/';
>>>>>            $attachement_upload .= $attachement;
>>>>>            $mime_msg->attach(
>>>>>                Type => 'image/gif',
>>>>>                Path => $attachement_upload,
>>>>>                Filename => 'attachement.gif'
>>>>>                ) or die "error attaching image: $!\n";
>>>>>            $mime_msg->send;
>>>>>            }
>>>>>}
>>>>>
>>>>>and use CGI::UploadEasy
>>>>>nice code
>>>>>correct
>>>> 
>>>> Thanks very much, John.
>>>in French I am French
>> 
>> Oui! Je suis très désolé, John. J'ai habité une fois en Strasbourgh, donc
>> j'aurais dû savoir mieux. Encore, merci beaucoup.  :-))
>c formidable 
>merci
Donc était votre assistance. ;)
-- 
Ed Jay (remove 'M' to respond by email)


------------------------------

Date: Thu, 15 Feb 2007 20:07:47 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: Sending a local attachment via email form
Message-Id: <45d4af76$0$25917$ba4acef3@news.orange.fr>

Todd wrote:

> Ed Jay wrote:
>> I know how to send an attachment that I create with a server-side email
>> routine (MIME::Lite). It requires me to have the attachment in a known
>> location on my host server.
>> 
>> Can anyone provide a hint regarding a site visitor sending a local
>> attachment using a Perl script fed with an HTML email form?
> 
> When they upload the file you know where it is on your server.
> 
> Todd
to install CGI::UploadEasy it is very simple


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 141
**************************************


home help back first fref pref prev next nref lref last post