How to go to a link and save a page and email it out?

Discussion in 'Perl Misc' started by dalewz@gmail.com, Dec 15, 2004.

  1. Guest

    Thanks for helps here. I tried the simple method - HTML::Mail.

    HTML::Mail works for some web sites. But it does not work for some. The
    results are:

    C:\Perl\scripts>mailp.pl
    Error while making request [ GET
    http://www.macom.com/Images/darkblue_bgcolor.gi
    f]
    404 Object Not Found at C:/Perl/lib/HTML/Mail.pm line 167.

    C:\Perl\scripts>

    -----Mail.pm
    164 my $response = $self->{'_ua'}->get($uri);
    165
    166 if (!$response->is_success) {
    167 die "Error while making request [ GET ", $response->request->uri,
    "]\n", $response->status_line;
    168 }

    However, if I use IE to open www.macom.com, I can save the page with
    all images. Any suggestions?

    Thanks a lot. -Dale
    PS> my script is:
    use HTML::Mail;

    ### initialisation
    my $html_mail = HTML::Mail->new(
    HTML => 'http://www.macom.com',
    >From => '',

    To => ', ',
    Subject => 'Alert page');

    ### Send the email ("inherited" from MIME::Lite)
    # $html_mail->send();
    $html_mail->send('smtp','outgoing.verizon.net');

    #### Remove text representation
    $html_mail->set_Text();

    ### Rebuild the message and send
    $html_mail->build->send;

    ### Serialise to file for later reuse
    $html_mail->dump_file('c:/html_mail.data');

    ### Restore from file
    my $restored = HTML::Mail->restore_file('c:/html_mail.data');
    , Dec 15, 2004
    #1
    1. Advertising

  2. Matt Garrish Guest

    <> wrote in message
    news:...
    > Thanks for helps here. I tried the simple method - HTML::Mail.
    >
    > HTML::Mail works for some web sites. But it does not work for some. The
    > results are:
    >
    > C:\Perl\scripts>mailp.pl
    > Error while making request [ GET
    > http://www.macom.com/Images/darkblue_bgcolor.gi
    > f]
    > 404 Object Not Found at C:/Perl/lib/HTML/Mail.pm line 167.
    >


    Did you maybe stop and think that the image isn't there? It really doesn't
    matter that you can open the page in IE and it looks okay to your eyes, as
    that has nothing to do with whether the image exists or not.

    The image doesn't exist, by the way, so you either go back to the drawing
    board, modify the code not to die if the image is missing, or email the
    author and ask him to.

    Matt
    Matt Garrish, Dec 16, 2004
    #2
    1. Advertising

  3. dale Guest

    Thank you all for the helps. I have found the solution by using
    WWW::Mechanize. It is really cool.

    -Dale
    dale, Dec 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    815
    Kevin Spencer
    May 17, 2005
  2. Flatch U. Lance
    Replies:
    7
    Views:
    1,032
    Flatch U. Lance
    Mar 4, 2006
  3. subhadip
    Replies:
    0
    Views:
    628
    subhadip
    Mar 28, 2007
  4. dale
    Replies:
    10
    Views:
    151
    Matija Papec
    Dec 17, 2004
  5. dale
    Replies:
    1
    Views:
    101
    Anno Siegel
    Dec 16, 2004
Loading...

Share This Page