RSS

framedrive::tumblr

- Simple is best -

気になったモノをメモ代わりにtumblrしてます

mobile版 :: http://framedrive.net/mobile

 

Sep 02
Permalink

[Plagger] Gmail error MIME::Lite::extract_addrs

Plagger::Plugin::Publish::Gmail [error] Error while sending emails: Undefined subroutine &MIME::Lite::extract_addrs called at C:/Perl/site/lib/Plagger/Plugin/Publish/Gmail.pm line 217.

上記エラーを力わざで解決.

どうせアドレスなんて固定だから,Gmail.pmを直接書き換えればいいかと.

コードは以下.

修正したところは,extract_addrsを含む行をコメントアウトし,直接変数あるいは配列に代入.ろくにCCもないからそこも全部カット.

で動いた.

# hack MIME::Lite to support TLS Authentication
*MIME::Lite::send_by_smtp_tls = sub {
my($self, @args) = @_;

### We need the “From:” and “To:” headers to pass to the SMTP mailer:
my $hdr = $self->fields();
# my($from) = MIME::Lite::extract_addrs( $self->get(‘From’) ); #comment out
my $from = ‘hogeuser’;
my $to = $self->get(‘To’);

### Sanity check:
defined($to) or Carp::croak “send_by_smtp_tls: missing ‘To:’ address\n”;

### Get the destinations as a simple array of addresses:
### my @to_all = MIME::Lite::extract_addrs($to);
my @to_all = (“example\@gmail.com”);

=pod
if ($MIME::Lite::AUTO_CC) {
foreach my $field (qw(Cc Bcc)) {
my $value = $self->get($field);
push @to_all, MIME::Lite::extract_addrs($value) if defined($value);
}
}
=cut