のみまくし日記

毎日が文化祭の前日、そんな環境っていいですよね。この日記は未来の自分へのメッセージです。

2007年01月28日 ()

Sledge::Plugin::Email::Japaneseで添付ファイル

な、パッチ。

@@ -37,6 +37,12 @@
             $self->session->param('last_mail' => $msg->as_string);
         }

+        if ($args->{Attachment}) {
+            for my $attachment (@{$args->{Attachment}}) {
+                $msg->attach(%$attachment);
+            }
+        }
+
         if ($sendmail_opt || $email_conf->{send}) {
             $msg->send(@{$sendmail_opt || $email_conf->{send}});
         } else {
@@ -66,6 +72,13 @@
                 TmplParams => {
                     name => $self->r->param('name'),
                 },
+                Attachment => [{
+                    Type     =>'image/gif',
+                    Path     =>'aaa000123.gif',
+                    Filename =>'logo.gif',
+                    Data     =>"Here's the GIF file you wanted"
+                    Disposition => 'attachment'
+                 }],
             },
         );
     }

Perl posted by takefumi | この日記へリンク | コメント(0) | トラックバック(0)

この日記へのトラックバック

この日記へのコメント