Email A Page

They have: 53 posts

Joined: Dec 1999

I am looking for a script that will email a page to people and not just send a refering email.

I have looked high and low and can only find one program out there that will do this and its a little expensive. Does anyone know of any free ones?

I have tried cgi-resources.com

------------------
http://www.coolresources.com

Rock Hosting - Rock Solid Hosting Solutions

They have: 161 posts

Joined: Dec 1999

I believe I know the process you are asking about. This would entail:

1. retrieving the page from the internet
2. adjusting all IMG tag urls to correctly source the image
3. adjusting all A tag urls to correctly source the URI

It doesn't sound too difficult a task, and I don't understand why it shouldn't be freeware -- I know there's a program called WebSnake that does this for an entire web site... oh well, capitalism is as capitalism does.

I'll post some code here when I think of it.

------------------
--
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve

They have: 2,390 posts

Joined: Nov 1998

What script did you find?
If we see it we might have a better idea of what you are after...
JP

They have: 161 posts

Joined: Dec 1999

Here is code to grab a URL and display it, with all the links and images intact. You can modify it at your leisure to email a person the web page.

The $ENV{REMOTE_HOST} tests are to determine if the program was called as a CGI program.

code:

#!/usr/bin/perl -w

# wgrab
# utility to grab URL and display normally

use CGI::Carp;
use LWP::Simple;
use strict;

my ($url,$src);

if ($ENV{REMOTE_HOST}) {
  # if sent via PATH_INFO...
  # PATH_INFO starts with a /
  $url = substr $ENV{$PATH_INFO}, 1;
}

# otherwise, value is in $ARGV[0];
$url | |= $ARGV[0];

die "usage: wgrab URL\n" unless $url;

$src = get($url);
$src =~ s!<head>!<head>\n<base href="$url">!i;

print "Content-type: text/html\n\n" if $ENV{REMOTE_HOST};
print $src;
[/code]

This places a <base href="..."> tag inside the <head> tag.

One final important note:  if you give this program a URL that is not a PAGE, but is rather a directory (as in [url=http://www.foo.com/)]http://www.foo.com/)[/url]  you MUST INCLUDE THE TRAILING SLASH.  http://www.foo.com  will make the <base> tag not work correctly.

That's all for now.

------------------
-- 
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve 

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.