2012-02-16 3 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

Sidenote :'$ $ 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 documentation

file 인수가 필수라고 말한다.

+0

괜찮지 만 사용해야하는 메시지 만 보내시겠습니까? – kanwarpal

+0

여기서 MailFg 대신 Mailmsg를 사용할 수 있습니까? – kanwarpal

+0

@kanwarpal 네,'$ :: sender-> MailFile (...) '대신'$ :: sender-> MailMsg (...)'를 입력하십시오. – Stamm

관련 문제