in reply to Re: Sending email using qmail
in thread Sending email using qmail

Thanks but what do I put on line six where it says #... ?

Replies are listed 'Best First'.
Re^3: Sending email using qmail
by Corion (Patriarch) on Feb 21, 2006 at 07:48 UTC

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

Re^3: Sending email using qmail
by moklevat (Priest) on Feb 21, 2006 at 14:16 UTC
    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.