i have a code, where that script is sending mail to the users, but i want to enhance
it, i.e i need to add attachment(zip file) to that, i dont want to use MIME:LITE module or any other module, with this simple code, i need to enhance.
below is my code
my %mail_params = (HTML => $mail_body,
Text => $mail_body,
From => $MAIL_FROM,
To => $MAIL_TO,
Subject => $mail_subject,);
$mail_params{HTML} = "<HTML><pre>$mail_params{Text}<\><\\HTML>";
my $mail = HTML::Mail->new(%mail_params);
$mail->send()
I dont want to use any modules, like MIME, sendmailer .....
i want to share this script which mails with attachments to end-users. where they done know about installations and modules, just they'll execute the script. that's y i dont want to install any module in customer system, simple mail with zip file attachment i need.
I came to know that i can use mutt command, to send mails with attachments, in shell i can send, and when i execute
`mutt -a <file_name> ak@apps.com < /dev/null`
in command line, i received mail with attachment, so i used this command in perl script using back quotes ` . i'm not able to execute properly. i'm getting an error as when i used mutt in perl script.
system(qq(mutt -a $LOGDIR asak@gmail.com) < /dev/null);
will results in syntax error
Bareword found where operator expected at att.pl line 2, near "/dev/null"
(Missing operator before null?)
syntax error at att.pl line 2, near "/dev/null"
Execution of att.pl aborted due to compilation errors.
and executing
system(qq(mutt -a $LOGDIR asak@gmail.com < /dev/null));
will results in same error :
Error sending message, child exited 67 (User unknown.).
Could not send the message.