Short answer: No.

Longer answer: The web is a stateless protocol, in other words your script only runs and generates (usually text) output and then quits, the output gets sent to the client by your webserver, which assuming they are running a standard webbrowser to connect to your script then all they can see is the output, wheither that output is a command or not.

There are some alternatives but it really depends on your clients having their own CGI script in which to grab your output and then email it that way. You can do that, but I think that probably defeats the purpose of what you're trying to do.

Finally the easy solution to what I think you're trying to do (correct me if I'm wrong) :), if you just want to show the email as being from a certain website or user, you can make the From: field of your outgoing email whatever you want it to be, regardless of where you actually send it from. Have a look at MIME::Lite which is my prefered method for sending email (easy to do attachments as well if you need something like that)

Hope that helps
Chris

Update fixed a typo.

Lobster Aliens Are attacking the world!

In reply to Re: How do I send an email using the user's sendmail program than my sendmail? by cfreak
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.