Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Unable to send the xls attachment file with the Mail::Sender

by jmcnamara (Monsignor)
on Nov 21, 2011 at 13:25 UTC ( #939196=note: print w/ replies, xml ) Need Help??


in reply to Unable to send the xls attachment file with the Mail::Sender

If you are using Spreadsheet::WriteExcel to generate the XLS file then you need to ensure that you close() the workbook prior to attaching it to an email. From the docs:

In general your Excel file will be closed automatically when your program ends or when the Workbook object goes out of scope, however the close() method can be used to explicitly close an Excel file. ... An explicit close() is required if the file must be closed prior to performing some external action on it such as copying it, reading its size or attaching it to an email.

--
John.


Comment on Re: Unable to send the xls attachment file with the Mail::Sender
Re^2: Unable to send the xls attachment file with the Mail::Sender
by mrguy123 (Hermit) on Nov 21, 2011 at 14:45 UTC
    Hi John, that's a good call. Had the same problem myself a few months ago
    I hope this solves Ree's problem
Re^2: Unable to send the xls attachment file with the Mail::Sender
by vinoth.ree (Parson) on Nov 22, 2011 at 10:10 UTC

    Thanks jmcnamara ++

    I am using the Spreadsheet::WriteExcel perl module to generate the xls file. I also checked the code and found that I did not close that file. Once I generate this xls file I am sending this xls file name for EmailSending program. Now I modified the code let me check and confirm.

    Update:

    Its working fine! thanks a lot

Re^2: Unable to send the xls attachment file with the Mail::Sender
by Ravi V (Scribe) on Sep 26, 2012 at 12:08 UTC
    thanks ... :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939196]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-12-21 01:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls