Please help to resolve the below script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Please help to resolve the below script
# 1  
Old 05-02-2011
Please help to resolve the below script

Dear Members,

Please help me to resolve below script. The script is used to send the attachment in the mail with all the details. However in one of the incidents, the attachment in the mail was blank. Now the client is after me to get it resolved ASAP. So prompt response would be highly appreciated. Please find the script below:-


Code:
if (condition ='Y') then  
  -- for sending the sumaary mail with reespect to abc_1 and xyz_1
l_write_line := '(echo To: '||recipient_list|| '; echo Subject: '||subject_line|| '; echo MIME-Version: 1.0; echo '||''''|| 'Content-Type: multipart/mixed; boundary="-q1w2e3r4t5"' ||'''' || '; echo; echo ' ||''''||'---q1w2e3r4t5'||'''' || '; echo Content-Type: text/html; echo Content-Disposition: inline; cat '||path_of_report|| '; echo '||'''' || '---q1w2e3r4t5' ||'''' || '; echo ' ||''''|| 'Content-Type: application; name="GEPI_AUDIT_SUMMARY_DETAILS.xls"'||'''' || '; echo Content-Type: text/html; echo ' ||''''|| 'Content-Disposition: attachment; filename="GEPI_AUDIT_SUMMARY_DETAILS.xls"'||''''|| '; cat '||path_where_report_will_be_attached|| '; echo '||''''||'---q1w2e3r4t5--'||''''||' ) | /usr/sbin/sendmail -t';
else 
  -- for just audit summary wrt movement name
l_write_line := '(echo To: '||recipient_list|| '; echo Subject: '||subject_line|| '; echo MIME-Version: 1.0; echo  Content-Type: text/html; echo Content-Disposition: inline; cat '||path_of_report|| '; ) | /usr/sbin/sendmail -t';


end if;


Thanking you in anticipation.

Regards,
SKO_TC

---------- Post updated at 10:02 AM ---------- Previous update was at 09:04 AM ----------

Dear Members,

It would be great if this gets resolved as early as possible. Please let me know if you want more details.

Regards,
SKO_TC

Last edited by joeyg; 05-02-2011 at 12:15 PM.. Reason: Please use CodeTags around commands
# 2  
Old 05-02-2011
Unclear the details on what would be different.

You stated that in one case the attachment was blank. You did not provide any details on data used to process this command. Further, it appears that your attachment is "hard-programmed" and thus, unusual to think that the attachment was blank.
Could the issue be something in the way the recipient's email is handling attachments? If only a problem for this one client, re-do your process keeping everything the same but direct that client's email to your own test email account - then you can verify whether blank or not.
This User Gave Thanks to joeyg For This Post:
# 3  
Old 05-02-2011
perhaps you should run
Code:
base64

on the xls file (mail is a 7-bit protocol and so a binary file such as an XLS should never be attached directly but rather the attachment should be
Code:
$(base64 $path_to_spreadsheet)

This User Gave Thanks to Skrynesaver For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Could not resolve ip through DNS

Dear all , Very recently our DNS server ip got changed. I have entered the DNS ip in /etc/resolv.conf ...but I could not resolv it for my ip address. Verified that , the IP is added in the DNS also. It is still working with the old DNS ip. Please let me know what could be... (11 Replies)
Discussion started by: jegaraman
11 Replies

2. Shell Programming and Scripting

How and What should I read/study to can resolve this script?

Hello everyone, I am a newbie on the world Shell Script. I just can build some scripts basically with the command which I used on the terminal. With the part algorithmic I don't have problem, but some functionality I can't and didn't know how around the situation. I have the file .txt with... (5 Replies)
Discussion started by: enodev
5 Replies

3. Shell Programming and Scripting

Cannot resolve $variable in awk

My script ---------- for i in `cat n`;do export k=`echo "CSN: "$i` //combining CSN: and value from n echo "$k" awk ''{print "CSN: "$0;}'{_=29}_&&_--' file1|tail -1 >> file2 done In the above script i cannot able to resolve $k in awk command file n contains ------------ 0000 1111 2222... (2 Replies)
Discussion started by: Mohana29_1988
2 Replies

4. Shell Programming and Scripting

Filter out IP addresses in domain resolve script

Hello everyone, I have written a one liner which looks in a configuration file for remote hosts to connect to. It then resolves them by first ping, and nslookup if it fails, then places the info in the hosts file. The whole thing works, seemingly, apart from one slight issue. I would like to... (0 Replies)
Discussion started by: haggismn
0 Replies

5. UNIX for Dummies Questions & Answers

Resolve IP to Hostname?

Good day, I would like to resolve IP's to Hostnames using Putty. I'm using Mandriva Linux 2008.0. Is this possible? Perhaps with nmap? (13 Replies)
Discussion started by: McGuywer
13 Replies

6. UNIX for Dummies Questions & Answers

Please resolve it

#!/bin/sh# 'clear'for i in $(seq -w 15 37)doecho $iecho The content in ZZ=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp`echo $ZA="Connection timed out."echo The content in Aecho $Aexpr "$A" : '..\(...\)'echo $Adone Hi,Please see the above program. The above... (9 Replies)
Discussion started by: veerumahanthi41
9 Replies

7. Shell Programming and Scripting

please resolve the below problem

#!/bin/sh # 'clear' for i in $(seq -w 15 37) do echo $i echo The content in Z Z=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.com:8000/webcore/test/test.jsp` echo $Z A="Connection timed out." echo The content in A echo $A expr "$A" : '..\(...\)' echo $A done ... (1 Reply)
Discussion started by: veerumahanthi41
1 Replies

8. Shell Programming and Scripting

Resolve a Variable

Hi I have a variable which is a path ie: UBERROR=/cobwrk/mchr/prodsup/ub/wrk/../error is there anyway I can get the output of an echo to read: #echo $UBERROR /cobwrk/mchr/prodsup/ub/error instead of #echo $UBERROR /cobwrk/mchr/prodsup/ub/wrk/../error Many thanks! (2 Replies)
Discussion started by: serm
2 Replies

9. UNIX for Dummies Questions & Answers

how do u resolve this????

Please help me on how to resolve: 1-unresponsive terminals 2-unresponsive applications 3-how to interrupt processe p.s unix/linux OS (1 Reply)
Discussion started by: zizu
1 Replies

10. IP Networking

Cannot Resolve Host Name

I am running LexMark MarkNetPro-3 print servers on my AIX network. All of the sudden, none of my printers will print anymore. I am getting an error message on the console: Unable to resolve host name. This message comes up everytime a user submits a print job. Any Ideas? (1 Reply)
Discussion started by: Docboyeee
1 Replies
Login or Register to Ask a Question