in reply to RE: Re: Getting response from a form
in thread Getting response from a form
I would change the To: line to include your address. Also, using a here doc makes your code look much neater. I'd also rethink the value of putting every parameter from the order page in one hash -- if you use a couple of different scalars and one big array, you won't have to go through that long section in the middle accessing each hash key directly. Specifically, make an array for orders, and join the the quantity, item, description, price, and total in each slot. Then just do a foreach loop over that array, and print each line to the MAIL filehandle.open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or die "Can't fork for sendmail: $!\n"; print SENDMAIL <<"EOF"; From: User Originating Mail <me\@host> To: Final Destination <you\@otherhost> Subject: A relevant subject line Body of the message goes here after the blank line in as many lines as you like. EOF close(SENDMAIL) or warn "sendmail didn't close nicely";
To debug this (as I'm not sure the ReadParse() subroutine is doing what you think it should), comment out the lines opening sendmail, and open the MAIL filehandle to print to a file somewhere, then run the program again. If you get what you'd normally expect in the e-mail, your problem is in the way you're opening sendmail. If you don't get what you expect in the file, you're probably not decoding the QUERY_STRING the way you expect. (That join statement just looks funny to me....)
|
|---|