ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My script collects information and writes it to a xls file and should mail it across.
I tested the first part of the script which writes the excel file , it does write the excel file fairly with expected data using Spreadsheet::WriteExcel module
Second part uses MIME::Lite , All I get is a mail with intended subject intact but without the attachment . Following is the code , I have googled and tried out many options , didn't go any further apart from receiving a mail without attachment.
use MIME::Lite;
$msg = MIME::Lite->new(
From => 'xx',
To => 'xx',
Subject => 'using module'
);
My script collects information and writes it to a xls file and should mail it across.
I tested the first part of the script which writes the excel file , it does write the excel file fairly with expected data using Spreadsheet::WriteExcel module
Second part uses MIME::Lite , All I get is a mail with intended subject intact but without the attachment . Following is the code , I have googled and tried out many options , didn't go any further apart from receiving a mail without attachment.
use MIME::Lite;
$msg = MIME::Lite->new(
From => 'xx',
To => 'xx',
Subject => 'using module'
);
Kindly advise me of what might be going wrong . Thanks in Advance.
First forget about Excel and try to send a plain text attachment.
...
I haven't read the documentation, but are you sure you have to call the 'attach' method twice ? And are you sure the return value of the 'attach' method shouldn't be checked for errors ?
Last edited by Sergei Steshenko; 03-01-2010 at 05:25 AM.
use strict;
use warnings;
use MIME::Lite;
my $msg = MIME::Lite->new(
From => 'xxx',
To => 'xxx',
Subject => ' Test message',
Type => 'multipart/mixed',
);
$msg->attach(
Type => 'text',
Data => "Here is the file",
);
$msg->attach(
Type => 'text',
Path => '/home/user/Documents/Assignment1',
Filename => 'Assignment1',
);
$msg->send;
Always mention the type of the data you going the send.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.