CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Attach file to webForm

 



pricklypear
Deleted

May 3, 2000, 2:17 AM

Post #1 of 6 (1271 views)
Attach file to webForm Can't Post

Hi People,
I am looking for a free Perl script where one could attach a file in a webform and it sends it as an email + attachment to a specified email address.

Hope you can help me out here.

Cheers

Pricklypear


Jasmine
Administrator

May 3, 2000, 6:31 AM

Post #2 of 6 (1271 views)
Re: Attach file to webForm [In reply to] Can't Post

I have not found a free program that does mail attachments. However, the least expensive one is only $9.95.
http://vipscripts.hypermart.net/vipfmailer.html


pricklypear
Deleted

May 4, 2000, 2:08 AM

Post #3 of 6 (1271 views)
Re: Attach file to webForm [In reply to] Can't Post

Well this is not really what I am looking for, btw i found this one somewhere for free!

I am looking for a script that allows users to attach a file to a webform and when they hit 'Send' it will send the form AND the attachment to me.

CHeers
P!


jumaru
Deleted

May 5, 2000, 3:38 AM

Post #4 of 6 (1271 views)
Re: Attach file to webForm [In reply to] Can't Post

Hi
I think you can do it in three steps:

1. upload the file to server.
2. attach file to an email in using the module Mime::lite.
3.delete file from server.

with this you can attach a file to a web form
I hope it helps you .


pricklypear
Deleted

May 10, 2000, 10:07 AM

Post #5 of 6 (1271 views)
Re: Attach file to webForm [In reply to] Can't Post

This sure sounds like the functionality that i need. HAs anyone done this before? if so where can i find a/the script?

P!


Cure
User

May 13, 2000, 11:51 AM

Post #6 of 6 (1271 views)
Re: Attach file to webForm [In reply to] Can't Post

Hi

Use the Mime::lite module to hadnle your email attachemnts

example this script will email the customer and you(you can change it how you want,its real easy) a form and a email picture.


#!/usr/bin/perl

use MIME::Lite;
#Create a multipart message (i.e., one with attachments):

# Create a new multipart 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 =>'multipart/mixed';

# Add parts (each "attach" has same arguments as "new"):
attach $msg
Type =>'TEXT',
Data =>"Here's the GIF file you wanted";
attach $msg
Type =>'image/gif',
Path =>'logo.gif',
Filename =>'logo.gif';

#Send a message:

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



Or you can do it bye hand instead of using a module--< which is harder...

Example (this will email you and whoever--> a cgi script(you can change it to whatever you want)


sub sendmailcustomer {


open(MAIL, "|/usr/sbin/sendmail -t") | | die "Can't open /usr/sbin/sendmail:$!";
print MAIL <<END_OF_MAIL;
To: you\@texas.net
CC: friend\@texas.net
From: you\@texas.net
Subject: This is a test
Content-Type: multipart/mixed; boundary="My-Boundry"
X-Mailer: guestbook.cgi
Status: O

--My-Boundry
Content-type: text/html


<html><body>
<BIG><BIG><B>THIS IS CURE</BIG></BIG></B>

</body></html>
--My-Boundry
Content-Type: text/plain; name="guestbook.cgi"
Content-Disposition: attachment; filename="guestbook.cgi"


END_OF_MAIL
open FILE,"guestbook.cgi"
or die "Could not open guestbook.cgi:$!";
select MAIL;
while (<FILE> ) {print}
close FILE;
close MAIL;
select STDOUT;


}

Cure



[This message has been edited by Cure (edited 05-13-2000).]

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives