Skip Menu |

This queue is for tickets about the MIME-Lite CPAN distribution.

Report information
The Basics
Id: 48308
Status: resolved
Priority: 0/
Queue: MIME-Lite

People
Owner: Nobody in particular
Requestors: asb_ehb [...] yahoo.de
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: add testfile for testing purposes
Hi! Mail::Mailer provides the possibility to send everything that would be send to sendmail to a testfile. I want that in MIME::Lite, too :) [quote] testfile Used for debugging, this displays the data to the file named in $Mail::Mailer::testfile::config{outfile} which defaults to a file named mailer.testfile. No mail is ever sent. [/quote] best regards, Alex
Subject: [patch] testfile for MIME::Lite
Here is a patch, or at least the code that does it: [code] #------------------------------ =item send_by_testfile FILENAME I<Instance method.> Print message to a file (namely FILENAME), which will default to mailer.testfile If file exists, message will be appended. =cut sub send_by_testfile { my $self = shift; ### Use the default filename... my $filename = 'mailer.testfile'; if ( @_ == 1 and !ref $_[0] ) { ### Use the given filename if given... $filename = shift @_; Carp::croak "Missing filename. Plaese specifiy a filename as first argument." unless $filename; } ### Do it: local *FILE; open FILE, ">> $filename" or Carp::croak "open $filename: $!\n"; $self->print( \*FILE ); close FILE; my $return = ( ( $? >> 8 ) ? undef: 1 ); return $self->{last_send_successful} = $return; } [/code]
merged -- rjbs