Click to See Complete Forum and Search --> : MailFile CGI-script HELP!


bpagan
09-15-2004, 09:36 AM
Here's what I'm trying to do:

When a user clicks "email" they are sent the page content in an email, not as an attachment, but as inline text/html. Exactly like the page on The JavaScript Source, http://javascript.internet.com/page-details/load-html.html there is a section after the script "We'll send this script to you!" It does exactly what I need.

I checked the site's FAQ section, they mentioned they used FreeScripts.com's MailFile CGI-script (http://www.FreeScripts.com/html/mail_main.shtml) however I can't seem to get to work without it sending the information as an attachment.

I need it to send as inline text.

Please help!!!!

Jona
09-15-2004, 10:45 AM
The script says that its purpose is to attach a binary or text file. The sticky post of this forum points to a few places where you can search for a "Send this page to a friend" script. You may want to check out <http://www.webreference.com/scripts/>, also.

bpagan
09-15-2004, 10:58 AM
The JavaScript Source mentioned they used the same code, but tweaked it... I'm trying to figure out how I should tweak the code to do the same thing The JavaScript Source has done. Any thoughts?

Jona
09-15-2004, 11:33 AM
The same code as in, the same code to which you originally linked?

bpagan
09-15-2004, 12:59 PM
Yeah

Jona
09-16-2004, 07:43 AM
The part that sends the attachment is:


foreach $file (@files) {

# Part #1: This is the body of the message:


# Part #2: Make Attachment:
if (-e "$filebase/$file") {
attach $top Path => "$filebase/$file",
Type => $auto_type,
Encoding => $auto_encoding;
}
else {
push(@not_found, $file);
}

}


You can try replacing it with:


open("TEMPD", "$filebase/$file") or die ("Error: $!");
my $_formTemp =~ s/\n/ /;
attach $top Data => $_formTemp;


If it just sends the last file data, instead of all of it, you'll need to append all the data into the $Body variable and then send it all at once.