kmlevine has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I’m new at Pearl and need to ask a dumb question. I have the follwing perl script which I need to configure to my computer. I use XP pro. Outlook and Comcast.net as my isp.

What do I enter in the - open(mail,”|/usr/sbin/sendmail –t”); line if I’m using Outlook – and Comcast.net as my isp?

Thanks for your help.

#!/usr/bin/perl $searchstring = "hp designjet"; $email = "kml\@comcast.net"; $localfile = "d:/ebay hacks/search 5-27.txt"; use WWW::Search; $searchobject = new WWW::Search('Ebay'); $query = WWW::Search::escape_query($searchstring); $searchobject->native_query($query); # *** put results into two arrays *** $a = 0; while ($resultobject = $searchobject->next_result()) { $a++; ($itemnumber[$a]) = ($resultobject->url =~ m!item=(\d+)!); $title[$a] = $resultobject->title; } # *** eliminate entries already in file *** open (INFILE,"$localfile"); while ( $line = <INFILE> ) { for ($b = $a; $b >= 1; $b--) { if ($line =~ $itemnumber[$b]) { splice @itemnumber, $b, 1; splice @title, $b, 1; } } } close (INFILE); $a = @itemnumber - 1; if ($a == 0) { exit; } # *** save any remaining new entries to file *** open (OUTFILE,">>$localfile"); for ($b = 1; $b <= $a; $b++) { print OUTFILE "$itemnumber[$b]\n"; } close (OUTFILE); # *** send email with new entries found *** open(MAIL,"|/usr/sbin/sendmail -t"); print MAIL "To: $email\n"; print MAIL "From: $email\n"; print MAIL "Subject: New $searchstring items found\n\n"; print MAIL "The following new items have been listed on eBay:\n"; for ($b = 1; $b <= $a; $b++) { print MAIL "$title[$b]\n"; print MAIL "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=$it +emnumber[$b]\n\n"; } close(MAIL);

Edited by Chady -- added code tags.

Replies are listed 'Best First'.
Re: perl and outlook
by neniro (Priest) on May 27, 2004 at 16:32 UTC
    I suggest you to use Mime::Lite for sending Mails from a win32-system. There isn't a sendmail-like MTA for win32 - AFAIK.
      Consider my really Slow with PEarl, but could you clarify how I interface this with the search module I'm trying to use. thanks, Ken
        Untested!
        use Mime::Lite; # # yada yada yada # my $data = "The following new items have been listed on eBay:\n"; $data .= "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=$_\n" for + @itemnumber; my $msg = MIME::Lite->new( From => 'me@Comcast.net', To => 'me@Comcast.net', Subject => "New $searchstring items found", Data => $data ); $msg->send('smtp', smtp.comcast.net);
Re: perl and outlook
by chanio (Priest) on May 28, 2004 at 03:33 UTC
    Actually, to be fair, there is a good one and freeware: http://pegasus.quantum.2ya.com/. Combining both servers: Pegassus + Mercury mail you can have more than what you have with Outlook and its server.

    If you are lucky enough to find a simple way of learning how to use it plainly, you'll be able to program over it, add filters, PopFile spam filtering, and the limit would be in your imagination. There is a mailing list.

    They may integrate with Outlook because you then have to change your email addresses in Outlook as localhost. All the work is handled by Mercury Mail. It classiffies, filters, and fetches the emails.

    I have my local Apache 2 sending emails via Mercury Server in a very simple way.

    To see/get it integrated with Apache 2 see: http://xampp.sourceforge.net/.

    .{\('v')/}
    _`(___)' __________________________