in reply to Sending email using qmail

How about using Mime::Lite and Mail::QmailQueue?

Here is some code from the QmailQueue documentation:
use Mail::QmailQueue; use Mime::Lite; # generate mail. my $mime = MIME::Lite->new( #... ); # send mail via qmail-queue. my $qmail = Mail::QmailQueue->new; $qmail->sender($ENV{USER}); $qmail->recipient('postmaster@foo.bar'); $qmail->data($mime->as_string); $qmail->send;

Replies are listed 'Best First'.
Re^2: Sending email using qmail
by keiusui (Monk) on Feb 21, 2006 at 07:45 UTC
    Thanks but what do I put on line six where it says #... ?

      Have you tried looking into the MIME::Lite documentation and adapting the examples there?

      This might duplicate a reply you received from another monk under your sendmail question, but the following works fine for me (taken almost verbatim from the MIME::Lite docs).
      #!/usr/bin/perl -w use strict; use MIME::Lite; my $msg = MIME::Lite->new( From =>'keiusui@qmailquestions.com', To =>'keiusui@qmailquestions.com', Subject =>'Helloooooo, nurse!', Data =>"How's it goin', eh?" ); $msg->send || die "It did NOT work!";

      If you use your own e-mail address in the To: and From: fields, does this work for you from the command line?
      To get any more help with this I think you are going to have to post some of your own code, and whatever error/behavior you observe.

      Update: Since you asked about the #..., I should have mentioned that the portion of the code above that defines $msg is what can be used to define $mime in the example I gave previously. However, as the present example shows, you do not necessarily need to use the Mail::QmailQueue module if your system has an alias from sendmail to qmail-inject or qmail-queue.