It is possible, but it may not have all of the advantages you think. The module you would want to look at if you wanted to do this is Net::SMTP (and you'll also want Net::DNS::Resolver to get the Mail Exchanger for the recipient), but it is not as simple as just firing off one function call to send the mail and being done. In effect, your Perl script has to _become_ the sending mail server, which means it ought to handle things like retrying later in the case of a temporary outage at the recipient's end. By the time you handle everything you need to handle, you may not be saving the overhead that you wanted to save. You also need to authenticate the user, but you need to do that even if you're using a local MTA to send. And make darn sure you log the user's IP address for each message-id, or put the user's IP in the headers, or both.


Quidquid latine dictum sit altum viditur.

In reply to Re: How do I send an email using the user's sendmail program than my sendmail? by jonadab
in thread How do I send an email using the user's sendmail program than my sendmail? by PerlBeginner

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.