Help for this page

Select Code to Download


  1. or download this
    Net::Cmd->code()
    Net::Cmd->message()
    
  2. or download this
    # Create ourselves an SMTP object
    my $smtp = Net::SMTP->new(
    ...
    $smtp->to("youthere\@mailserver.de")
       or die "Error on RCPT TO: ", $smtp->code(), " ", $smtp->message();
    $smtp->quit;
    
  3. or download this
    $smtp->mail("postmaster\@mailserver.co.za", Size => 52428800);
    if ( $smtp->status() =~ /^[45]$/ ) {
       # informative error here
       exit(1);
    }
    
  4. or download this
    if ( $smtp->status() =~ /^[45]$/ ) {
       if ( $smtp->message() eq "size limit exceeded" ) {
    ...
          print "The message is too big. Boo-hoo\n";
       }
    }