Loading ...
Sorry, an error occurred while loading the content.

Sending mail in perl?

Expand Messages
  • willieej2002
    Hey everyone. Can someone provide me with an example of how to send email in Perl? It would be greatly appreciated, thanks. :) -Willie
    Message 1 of 6 , Jun 21, 2004
    View Source
    • 0 Attachment
      Hey everyone. Can someone provide me with an example of how to send
      email in Perl? It would be greatly appreciated, thanks. :)



      -Willie
      http://groups.yahoo.com/group/allprogramming -- AllProgramming!
      Newsletters containing tips, tricks, hints, and more for ALL
      programming langauges!
    • merlyn@stonehenge.com
      ... willieej2002 Hey everyone. Can someone provide me with an example of how to send willieej2002 email in Perl? It would be greatly appreciated, thanks.
      Message 2 of 6 , Jun 21, 2004
      View Source
      • 0 Attachment
        >>>>> "willieej2002" == willieej2002 <willieej2002@...> writes:

        willieej2002> Hey everyone. Can someone provide me with an example of how to send
        willieej2002> email in Perl? It would be greatly appreciated, thanks. :)

        Google for "mail perl". Or go to search.cpan.org and type "mail"
        into the search box.

        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
        See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
      • Durai
        Hi, You can use sendmail: open(SENDMAIL, |/usr/sbin/sendmail -t ) or die Can t fork for sendmail: $! n ; print SENDMAIL
        Message 3 of 6 , Jun 21, 2004
        View Source
        • 0 Attachment
          Hi,

          You can use sendmail:

          open(SENDMAIL, "|/usr/sbin/sendmail -t") or die "Can't fork for sendmail:
          $! \n";
          print SENDMAIL <<"EOF";
          From: Tom Christiansen <durai\@...>
          To: Nathan Torkington <jogn\@...>
          Subject: Re: The Perl Cookbook

          Hi,

          Regards,
          Durai.
          EOF
          close(SENDMAIL);

          If you have Mail::Mailer module,

          use Mail::Mailer;

          $mailer = Mail::Mailer->new("sendmail");
          $mailer->open({ From => $from_address,
          To => $to_address,
          Subject => $subject,
          })
          or die "Can't open: $!\n";
          print $mailer $body;
          $mailer->close();


          Regs,
          Durai.

          ----- Original Message -----
          From: willieej2002
          To: perl-beginner@yahoogroups.com
          Sent: Tuesday, June 22, 2004 5:27 AM
          Subject: [PBML] Sending mail in perl?


          Hey everyone. Can someone provide me with an example of how to send
          email in Perl? It would be greatly appreciated, thanks. :)



          -Willie
          http://groups.yahoo.com/group/allprogramming -- AllProgramming!
          Newsletters containing tips, tricks, hints, and more for ALL
          programming langauges!



          Unsubscribing info is here:
          http://help.yahoo.com/help/us/groups/groups-32.html


          Yahoo! Groups Sponsor
          ADVERTISEMENT






          Yahoo! Groups Links

          To visit your group on the web, go to:
          http://groups.yahoo.com/group/perl-beginner/

          To unsubscribe from this group, send an email to:
          perl-beginner-unsubscribe@yahoogroups.com

          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          ---
          Outgoing mail is certified Virus Free.
          Checked by AVG anti-virus system (http://www.grisoft.com).
          Version: 6.0.707 / Virus Database: 463 - Release Date: 6/15/2004
        • merlyn@stonehenge.com
          ... Durai open(SENDMAIL, |/usr/sbin/sendmail -t ) or die Can t fork for sendmail: Unfortunately, this means that sendmail must be installed, and at that
          Message 4 of 6 , Jun 21, 2004
          View Source
          • 0 Attachment
            >>>>> "Durai" == Durai <tech_durai@...> writes:

            Durai> open(SENDMAIL, "|/usr/sbin/sendmail -t") or die "Can't fork for sendmail:

            Unfortunately, this means that sendmail must be installed, and
            at that location.

            --
            Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
            <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
            Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
            See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
          • Alan C.
            Hi, To check my email that s on (my account) pop3 server at my ISP and delete all mail that is over a week old. I looked on CPAN but didn t find anything that
            Message 5 of 6 , Jun 21, 2004
            View Source
            • 0 Attachment
              Hi,

              To check my email that's on (my account) pop3 server at my ISP and delete all mail that is over a week old.

              I looked on CPAN but didn't find anything that already does that.

              I've sent mail using Perl to do so. And, I've retrieve alright using Net::POP3

              My workstations used, need both for Windows and also on Linux -- I seek: How to keep a week's worth of mail on ISP's (probably Linux) pop3 server and delete all from server that is over a week old.
              --

              I could use Net::POP3 to download all headers to a file. Then iterate over the date line of each header and correspondingly record the number of dates that are older than a week. Then assign a range of from 1 to whatever, for example 17. So, 1 to 17 are to be deleted. Two runs of Net::POP3. First run needed to get all headers; second run to delete the desired emails from server.

              Or, did I miss something (hopefully that's better and already written), either here, or CPAN, or elsewhere?

              Thanks.
              --
              Alan.
            • michael watson (IAH-C)
              The modules you may like to look at are: Mail::Sendmail; Mail::Sender; I used the first with great success until I found it REALLY drags with rather huge
              Message 6 of 6 , Jun 22, 2004
              View Source
              • 0 Attachment
                The modules you may like to look at are:

                Mail::Sendmail;
                Mail::Sender;

                I used the first with great success until I found it REALLY drags with
                rather huge messages, and so I switched to the latter, which doesn't :-)

                -----Original Message-----
                From: willieej2002 [mailto:willieej2002@...]
                Sent: 22 June 2004 00:57
                To: perl-beginner@yahoogroups.com
                Subject: [PBML] Sending mail in perl?


                Hey everyone. Can someone provide me with an example of how to send
                email in Perl? It would be greatly appreciated, thanks. :)



                -Willie
                http://groups.yahoo.com/group/allprogramming -- AllProgramming!
                Newsletters containing tips, tricks, hints, and more for ALL programming
                langauges!




                Unsubscribing info is here:
                http://help.yahoo.com/help/us/groups/groups-32.html
                Yahoo! Groups Links
              Your message has been successfully submitted and would be delivered to recipients shortly.