MyoungSoo Gang
MyoungSoo Gang

Reputation: 31

Solaris10 Send a email with .csv attached

i am trying to send a email with multiple .csv files from Solaris10 to someone

i have two questions now

  1. i did source codes below

(uuencode test/test.csv test/test.csv; uuencode test/test1.csv test/test1.csv) | mailx -s test "[email protected] cc:[email protected]"

with this command, Although i could send a email with .csv files

when i receive that email from Gmail, there was no problem

but on other Emails (outlook...) there were no files attached and were changed to some weird texts and involved into email context.

Could you please explain what is happening here and the solution?

  1. if there is another option, please tell me ( i can only use Perl, as my company allow me to use only Perl, in addition, if i can avoid to use Perl modules then it would be better)

thank you guys

Upvotes: 0

Views: 270

Answers (1)

Dave Cross
Dave Cross

Reputation: 69314

Saying "if i can avoid to use Perl modules then it would be better" isn't the same as saying "I can't use any Perl modules", so here is the currently recommended way to do this. It uses the Email::Stuffer module.

use Email::Stuffer;

Email::Stuffer->from('someone@somedomain')
              ->to('someone.else@someotherdomain')
              ->text_body("Here's the data")
              ->attach_file('test/test.csv')
              ->attach_file('test/test1.csv')
              ->send;

The documentation also includes an example of doing the same thing using the older, Email::MIME to demonstrate how much simple it is with the newer module.

If you're not using CPAN, then you're not using most of the power of Perl. Setting up the ability to easily install and use CPAN modules will make your life far more enjoyable.

Upvotes: 1

Related Questions