Loading ...
Sorry, an error occurred while loading the content.
 

$Server->Mail() and specifying mailhost

Expand Messages
  • Broc Seib
    I want to specify my mail host at the moment I call $Server- Mail(); I see I can pass in some %smtp_args to the Net::SMTP new() constructor: $Server- Mail({
    Message 1 of 2 , Sep 9, 2002
      I want to specify my mail host at the moment I call $Server->Mail();

      I see I can pass in some %smtp_args to the Net::SMTP new() constructor:

      $Server->Mail({
      'To' => $to,
      'From' => $from,
      :
      :
      },
      %smtp_args,
      );

      But looking at the code of Net::SMTP (version 2.19) it only accepts as
      a scalar first argument the name of the mailhost. Net::SMTP::new does
      this by checking to see if there are an odd number of args in @_;

      Anyhow, I'd like to be able to do this like:

      $Server->Mail({
      'To' => $to,
      'From' => $from,
      :
      :
      },
      mailhost,
      %smtp_args,
      );

      Comments anyone?
      -broc

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... How about about setting the config at runtime, like: $Server- Config( MailHost , $your_mailhost); Do this just before the $Server- Mail(). If you really
      Message 2 of 2 , Sep 11, 2002
        Broc Seib wrote:
        > I want to specify my mail host at the moment I call $Server->Mail();
        >
        > I see I can pass in some %smtp_args to the Net::SMTP new() constructor:
        >
        > $Server->Mail({
        > 'To' => $to,
        > 'From' => $from,
        > :
        > :
        > },
        > %smtp_args,
        > );

        How about about setting the config at runtime, like:

        $Server->Config('MailHost', $your_mailhost);

        Do this just before the $Server->Mail(). If you really
        need this in the $Server->Mail routine, let me know,
        and we can probably add something there too.

        Note that currently, the MailHost config will become
        cached in the ASP object when it first gets used,
        so you will need to set your MailHost only once, like in
        Script_OnStart for example, but that the MailHost will
        persist for subsequent Server->Mail calls.

        Regards,

        Josh
        ________________________________________________________________
        Josh Chamas, Founder phone:925-552-0128
        Chamas Enterprises Inc. http://www.chamas.com
        NodeWorks Link Checking http://www.nodeworks.com


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      Your message has been successfully submitted and would be delivered to recipients shortly.