Perl - EMail issue - NEED Help


 
Thread Tools Search this Thread
Top Forums Programming Perl - EMail issue - NEED Help
# 1  
Old 03-30-2017
Perl - EMail issue - NEED Help

I have a perl that is sending emails in a bad format:
Code:
"begin 644 Included.doc
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BH*4U5#0T534T953"!-1$XG<R!F;W(@07)C:&EV92!022`M
M($-A;F-E;`HJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*@HW-C`T,C<Q-S`Y"BHJ*BHJ*BHJ*BHJ*BHJ"
"

Here is the code used to email the doc file:
Code:
  $includeListEmail = "NPSTool.IncludeListEmail.txt";
     if ($emailFlag eq "Y") {
        `uuencode ${includeListEmail} Included.doc > /tmp/test.Included.doc`;
        `uuencode ${excludeListEmail} Excluded.doc > /tmp/test.Excluded.doc`;
        `echo|mailx -s "TOOL: $myScenario" -a /tmp/test.Included.doc -a /tmp/test.Excluded.doc myemail@yahoo.com`;
        }

It seems to be an issue using the uuencode. It is not converting the text report into a word document. OS is Linux redhat 7.2 and using perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
How can I change my Perl to send the doc file as attachment ?

Thanks

Last edited by mrn6430; 03-30-2017 at 04:52 PM.. Reason: code tags
# 2  
Old 03-31-2017
Quote:
Originally Posted by mrn6430
...
Code:
  $includeListEmail = "NPSTool.IncludeListEmail.txt";
     if ($emailFlag eq "Y") {
        `uuencode ${includeListEmail} Included.doc > /tmp/test.Included.doc`;
        `uuencode ${excludeListEmail} Excluded.doc > /tmp/test.Excluded.doc`;
        `echo|mailx -s "TOOL: $myScenario" -a /tmp/test.Included.doc -a /tmp/test.Excluded.doc myemail@yahoo.com`;
        }

...
With "mailx -a" you do not need the uuencode command.
Try something like this:

Code:
 echo "Text_for_email_body" | mailx -s "Email_subject" -a NPSTool.IncludeListEmail.txt <recipient_email_address>

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mailx Email Issue

Hello, I am facing an issue with email in Linux. I am using mailx command to send email. When I give invalid domain address then it is taking both sender and recipient as sender email and trying to send email. Below is my command echo -e "${EMAIL_TEXT}" | mailx -v -s "${SUBJECT}" -r... (5 Replies)
Discussion started by: yuvi
5 Replies

2. Shell Programming and Scripting

Issue with email sent from Linux server

I have written a shell script to send email to users with message body and attachment. Message body has registered symbol. But when I receive the email, registered trademark symbol has a special character prefixed and appears carlington work® whereas I am expecting to see only carlington work® .... (3 Replies)
Discussion started by: Leo87
3 Replies

3. Shell Programming and Scripting

Email issue

hi all, i am not getting with the email attached not sure what wrong with the syntax can u help me out plz. cat notavailabltext.txt please reach to team for any issues. uuencode notavailable.txt notavailable.txt | mailx -m -s "Files are available" arun@trival.com < notavailabltext.txt (6 Replies)
Discussion started by: arun888
6 Replies

4. Shell Programming and Scripting

UNIX email issue

Hi all, I have tried to send an email with the below script. but i am not getting the subject of the email where it is present in the simply.txt. I am using HP UNIX server. I am not sure what mistake i made in the below unix command. any help would be appreciated. cat simply.txt ... (2 Replies)
Discussion started by: arun888
2 Replies

5. Forum Support Area for Unregistered Users & Account Problems

Email address change issue

Hi Neo/Scott, I decided to change my email address in my details from my earlier one to the one I got with my VIP membership. After the change, I got a message that I'll receive an activation link at the new address to re-activate my account. I haven't got that link till now. Also, all my... (3 Replies)
Discussion started by: elixir_sinari
3 Replies

6. Shell Programming and Scripting

issue with Email Body

Hi, I have written shell program to send email as below - #!/bin/ksh filename=`ls -ltrh *.Z` echo $filename |mailx -s "FOR TESTING" rahul.b@infotech.net I am getting the email but email body is - -rw-rw-r-- 1 bahulra dba 173M Mar 22 04:37 corphist.txt.Z -rw-rw-r-- 1 bahulra dba 107M... (3 Replies)
Discussion started by: rahulbahulekar
3 Replies

7. Emergency UNIX and Linux Support

AIX: Production email issue

Hello, system generated emails sent to users from production scripts within Aix arent going out. In the errpt -a output I see: _______________________________________________________ LABEL: SRC_SVKO IDENTIFIER: BC3BE5A3 Date/Time: Tue Mar 13 16:28:07 EDT 2012 Sequence... (2 Replies)
Discussion started by: NycUnxer
2 Replies

8. Shell Programming and Scripting

Crontab issue: getting email but with out body

I have a oracle sh script test.sh #!/bin/bash R=`sqlplus -S *****/*********@dfsdf <<ENDOFSQL set serveroutput on size unlimited; execute DBMS_SNAPSHOT.REFRESH( '"MIS_ADMIN"."MV_SURVEY_UNITS_CENSUS"','F'); execute DBMS_SNAPSHOT.REFRESH( '"MIS_ADMIN"."MV_SURVEY_UNITS_CENSUS_PART"','F');... (1 Reply)
Discussion started by: ramkia6
1 Replies

9. UNIX for Advanced & Expert Users

strange aunthentication issue with email

hi again i'm running a centos 4.x box with sendmail and openwebmail. I had a weird situation where users couldn't not get authenticated using a pop mail client but but were able to aunthenticate using the openwebmail webmail client. I looked through the logs and didn't see anything strange. I... (0 Replies)
Discussion started by: mcraul
0 Replies

10. Solaris

Crontab email issue

Hi, I have a script that sends a db extract file as an email attachment. I have a crontab created to run it everyday at 8 am.. 00 08 * * * ksh /home/rtaaa/tbasd/report.sh > /home/rtaaa/tbasd/logs/report.log When i just run the "ksh /home/rtaaa/tbasd/report.sh >... (5 Replies)
Discussion started by: ryannam
5 Replies
Login or Register to Ask a Question