PDA

View Full Version : How to do sendmail and upload file using cgi-perl


Fellicia
08-24-2000, 01:59 AM
I hope someone would help me in this coz I'm a new bee in cgi-perl.

1) I have a form for user to key in data where these info will be sent to a email address. I've tried this code :

$subject = "new proposal";
open(MAIL, "|/usr/lib/sendmail fellicia\@g-lab.com");
print MAIL "from : me";
print MAIL "to : u";
print MAIL "subject : $subject";
print MAIL "hai hai hai";
close MAIL;

I'm not sure at the email address part, do i need to add \ beside @. If i don't, i get error. Anyway, after i add \, the code is ok but i can't get the mail. So is this correct or i can use anotehr way?

2) I would allow user to upload their resume to my server instead of typing again and again. So, how to do uploading file?

Thank's. :)

Regards, Fellicia
(Email : fellicia@g-lab.com)

Jacob
08-24-2000, 02:31 AM
Hi Fellicia,

First thing I recommend doing:

Change the following:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
open(MAIL, "|/usr/lib/sendmail fellicia\@g-lab.com");
[/code]

To:

<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
open(MAIL, "|/usr/lib/sendmail fellicia\@g-lab.com") | | print "Cannot Open Sendmail!\n";;
[/code]

This will tell us if sendmail is the problem, which it most likely is. If you do get this error, try changing your path to sendmail to this: /usr/sbin/sendmail

As this is the default path on most unix/linux systems.

Hope this helps!

Regards,

------------------
Jacob A. Wheeler
Co-Founder / Web Engineer
Big Resources Network
jacob@bigresources.com
ICQ: 390147 (http://www.icq.com/390147)

Titan
08-24-2000, 07:18 AM
/usr/sbin/sendmail -t

I have found the -t switch to help on a couple of servers, of course the path may need to be modified...



------------------
Best of Luck!

Titan
ICQ 37149892