2012-02-16 34 views
-3
use strict; 
use warnings; 
use Mail::Sender; 

$::sender = new Mail::Sender 
    {smtp => 'xx.xx.xx.xxx', from => '[email protected]'}; 

$::sender->MailFile({to => '[email protected]', 
    subject => 'Here is the file', 
    msg => "I'm sending you the list you wanted.", 
    }); 
+1

エラーメッセージを投稿できますか? – Stamm

+2

サイドノート: '$ $ var = ... 'ではなく、' my $ var = ... 'を使ってください。後者のユースケースはありますが、後者のユースケースはありません。 – Dallaylaen

+0

Stamm:私はこのエラーが発生していません...... – kanwarpal

答えて

1

実際にはファイルを送信しません。これを使用してみてください:

$::sender->MailFile({to => '[email protected]', 
    subject => 'Here is the file', 
    msg => "I'm sending you the list you wanted.", 
    file => 'full_path_to_your_attachment'}); 

Mail::Sender documentationfile引数が必須であることを述べています。

+0

okですが、私は使用すべきメッセージのみを送信しますか? – kanwarpal

+0

ここでMailFileではなくMailmsgを使用できますか? – kanwarpal

+0

@kanwarpal はい、「$ :: sender-> MailFile(...)」の代わりに '$ :: sender-> MailMsg(...)'と入力してください。 – Stamm

関連する問題