GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
TheSchwartz::Worker::SendEmail(3) User Contributed Perl Documentation TheSchwartz::Worker::SendEmail(3)

TheSchwartz::Worker::SendEmail - sends email using SMTP

  use TheSchwartz;
  use TheSchwartz::Worker::SendEmail;
  TheSchwartz::Worker::SendEmail->set_HELO("example.com");
  my $sclient = TheSchwartz->new(databases => \@Conf::YOUR_DBS);
  $sclient->can_do("TheSchwartz::Worker::SendEmail");
  $sclient->work; # main loop of program; goes forever, sending email

This is a worker class for sending email (designed for lots of email) using TheSchwartz job queue and a slightly-tweaked subclass of Net::SMTP. See TheSchwartz for more information.

When constructing a SendEmail job using TheSchwartz's insert_job method, construct your TheSchwartz::Job instance with its 'argument' of the following form:

   {
      # recipients:
      rcpts    => [ $email1, $email2, ... ],
      env_from => $envelope_from_address,
      data     => $headers_and_body_as_big_string,
   }

Note that "Bcc:" headers will be removed, and a "Message-ID" header will be added if not present, but nothing else is magical. This module does no MIME, etc. There are other modules for that.

   TheSchwartz::Worker::SendEmail->set_resolver($net_dns_resolver_obj)

Sets the DNS resolver object to use. By default, just uses a new Net::DNS::Resolver.

   TheSchwartz::Worker::SendEmail->set_HELO("example.com");

Sets the domain to announce in your HELO.

    TheSchwartz::Worker::SendEmail->set_on_5xx(sub {
        my ($email, $thesch_job, $smtp_code_space_message) = @_;
    });

Set a subref to be run upon encountering a 5xx error. Arguments to your subref are the email address, TheSchwartz::Job object, and a scalar string of the form "SMTP_CODE SMTP_MESSAGE". The return value of your subref is ignored.

Brad Fitzpatrick -- brad@danga.com

Copyright 2006-2007, SixApart, Ltd.

License to use under the same terms as Perl itself.

This software comes with no warranty of any kind.

TheSchwartz
2007-04-25 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.