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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.