bhaskar_219 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Masters,

Requirements:<.p>

1. Send an email without Configuration,From address is not important, only To address is important.

2. Sender email address will mention in program but its not configured in program to send a mail.

Requesting your help. Thanks

Replies are listed 'Best First'.
Re: Sending Mails without configuration
by moritz (Cardinal) on Oct 09, 2010 at 17:30 UTC

    If you approach a problem that's not already solved in the core of perl, go to http://search.cpan.org/ and see if there's a module that does what you want. MIME::Lite is often recommended.

    That said, sending emails without configuration may work, but many spam protection measures will reject it.

    The bare minimum you should have is a proper From-address, and having a DNS entry for that domain that points to the IP of the machine where you send the mail from.

    Or even better, use an account on a mail server that is maintained by somebody who knows his job.

    Perl 6 - links to (nearly) everything that is Perl 6.
Re: Sending Mails without configuration
by locked_user sundialsvc4 (Abbot) on Oct 10, 2010 at 14:59 UTC

    Obviously, we need considerably more information about what you are trying to do, and what programs you are dealing with.

    One strategy that works fairly well, when you are trying to “graft” functionality into a legacy program that doesn’t have it, is to use a separate program that is connected to the first by a FIFO queue, or “pipe.”   When the first program wants to (say...) send an e-mail to someone, it writes a record to the pipe, containing the relevant information.   The second program, which is asleep waiting for records to arrive in that pipe, then wakes-up and processes the message, independently of the first program and asynchronous to it.

    It is usually possible to define pipes to have “many writers” (if you like) “many readers.”   So, a single e-mailer program might be able to handle the needs of many client programs.   The pipe acts as a convenient, flexible buffer between them.

    This is a general approach that can be readily implemented in Perl, but that is not specific to Perl.

Re: Sending Mails without configuration
by Anonymous Monk on Oct 09, 2010 at 17:29 UTC
    Not sending mails at all