[Chicago-talk] emailing from perl

Andrew Rodland arodland at comcast.net
Wed Aug 1 21:36:36 PDT 2007


On Wednesday 01 August 2007 11:24:41 pm Jay Strauss wrote:
> Hi,
>
> I'm trying to use this program called "websec".  Its sort of a poor
> man's RSS.  Its supposed to look at a webpage and notice if its
> changed, and if so, email the updated page.
>
> I can't get the emailing to work on my machine.  I snipped out the
> code in the program that does the emailing (below).  I don't get how
> the email would be sent.  Doesn't there need to be some sort of email
> client setup to send this to an SMTP server or something?
>
> [ code using an LWP POST to send mail ]

There is in fact an LWP::Protocol::mailto which is supposed to be able to send 
mail when used exactly this way... the problem is that it only knows how to 
do one thing, which is pipe through sendmail (if, of course, it can find it 
in one of three predefined locations). So, hardly portable. I'd suggest 
tearing it out and replacing it with calls to Email::Send, which knows 
several ways to send mail, so you can tell it about one that will work for 
you. Or else, you can tell it to be smart and try several :)

Andrew


More information about the Chicago-talk mailing list