Send Email To Windows OS Preserving The Format


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Send Email To Windows OS Preserving The Format
# 8  
Old 06-07-2013
okay i used the unix2dos, when i check in outlook it all in single line. But when i download the actual data file into Windows OS via winscp and looked at it looks fine..

Outlook:
Code:
Informatica Was Able To Successfully Load the Provider File Provider:16, Uninum:710119, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:610000, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710056, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710122, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710139, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710739, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710150, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710549, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710862, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710551, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710973, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710981, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710990, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:810586, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710566, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710659, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710924, Extract Date:2012-09-30, Loading Status:COMPLETED Provider:16, Uninum:710985, Extract Date:2012-09-30, Loading Status:COMPLETED

Download to Windows:
Code:
Informatica Was Able To Successfully Load the Provider File
Provider:16, Uninum:710119, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:610000, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710056, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710122, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710139, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710739, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710150, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710549, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710862, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710551, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710973, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710981, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710990, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:810586, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710566, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710659, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710924, Extract Date:2012-09-30, Loading Status:COMPLETED
Provider:16, Uninum:710985, Extract Date:2012-09-30, Loading Status:COMPLETED

Modified code:
Code:
 echo "Provider:"$PROVIDER", Uninum:"$UNINUM", Extract Date:"$EXTRACT_DT", Loading Status:"$PROCESS_STATUS"" \
             >> "${LOG_DIR}"/StageLoadEmailBody

done
(cat ${LOG_DIR}/StageLoadEmailBody) | unix2dos | /bin/mailx -s "Provider File Loaded Successfully" "${EMAIL_LIST}"

I need the the output in outlook also in same format please help
Thank you.
# 9  
Old 06-07-2013
Just tested for you:
Code:
\tail -8  /var/cron/log/m_ux.log | \ux2dos | \mailx -s "Aaaarghh NO MILK FOR MY MORNING TEA " me@mywork.com

Works...
This User Gave Thanks to vbe For This Post:
# 10  
Old 06-07-2013
Do i need to make any changes it's not working for me. email is coming out as empty. I made a executable(755) file called ux2dos in my bin directory. I changed the script to below.

Code:
echo "Provider:"$PROVIDER", Uninum:"$UNINUM", Extract Date:"$EXTRACT_DT", Loading Status:"$PROCESS_STATUS"" \
             >> "${LOG_DIR}"/StageLoadEmailBody

done
(cat ${LOG_DIR}/StageLoadEmailBody) | ux2dos | /bin/mailx -s "Provider File Loaded Successfully" "${EMAIL_LIST}"

# 11  
Old 06-07-2013
Try like this
Code:
\cat $LOG_DIR/StageLoadEmailBody | \ux2dos | \/bin/mailx -s "Provider File Loaded Successfully" "${EMAIL_LIST}"


Last edited by vbe; 06-07-2013 at 04:05 PM.. Reason: typo
# 12  
Old 06-07-2013
The email body is coming out as empty..I am using bash and dos2unix is in ksh. is that causing the issue?
# 13  
Old 06-07-2013
That script ought to work fine in bash, it and ksh are similar in many ways.

It expects a filename, though. unix2dos filename It will edit the file.
This User Gave Thanks to Corona688 For This Post:
# 14  
Old 06-07-2013
I tried using unix2dos as well, for some reason in the outlook i see spaces between the lines.

---------- Post updated at 01:48 PM ---------- Previous update was at 01:30 PM ----------

I didn't understand and not able to figure out what's happening. when i edit sample.txt file and use a simple command.
Code:
 mailx -s "Test" "xxx@fxxxg.com" <sample.txt

every line is intact. But when i send email with file generated from echo commands and all format options its still not working...i am frustrated.

Code:
Hello Everyone
Is this thing really difficult

---------- Post updated at 02:15 PM ---------- Previous update was at 01:48 PM ----------

Finally, if i remove the commas its working fine i see the expected format in outlook all lines. Do you know why please ?

Code:
     #echo "Provider:"$PROVIDER", Uninum:"$UNINUM", Extract Date:"$EXTRACT_DT", Loading Status:"$PROCESS_STATUS"" \
        #>> "${LOG_DIR}"/StageLoadEmailBody
        echo "Provider:$PROVIDER Uninum:$UNINUM Extract Date:$EXTRACT_DT Loading Status:$PROCESS_STATUS" >> "${LOG_DIR}"/StageLoadEmailBody
        #echo -e "\r">> "${LOG_DIR}"/StageLoadEmailBody
done
(cat "${LOG_DIR}/StageLoadEmailBody") | /bin/mailx -s "Provider File Loaded Successfully" "${EMAIL_LIST}"

probably outlook intelligently treating comma as continuation of paragraph hence wrapping up the lines ..quite a ride
Thank you
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Preserving the format of top command result

hi, I have tried the below command in RHEL5: top|mailx -s "test" "abc@cvf.com" But in the mail the content was not in proper format. Is there any way to preserve the format ? Thanks (2 Replies)
Discussion started by: pandeesh
2 Replies

2. UNIX for Dummies Questions & Answers

new to ldap, send email to a ou or group, and see a list from email client

hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version). i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010). a. i cant see a list of the contacts,... (0 Replies)
Discussion started by: V4705
0 Replies

3. Shell Programming and Scripting

format log file and send in email.

Hi guys i have one script which is as below do some sqlplus output in to $LOG sed '/^$/d' $LOG > /tmp/job.log mv /tmp/job.log $LOG awk '{if ($5=="COMPLETED") {print "backup completed at "$3" "$4 " of " $6 " for " d>> "/home/email.log" } else {print "check backup for " d}}' d="$ORACLE_SID"... (2 Replies)
Discussion started by: tapia
2 Replies

4. UNIX for Advanced & Expert Users

How to send email as HTML format with attachment ?

hi.. Could somebody help me how to sent an attachment using sendmail command and the content is HTML format ?. Below is my code to sent the email as HTML but i do not know how to sent the attachment, please help me To: "BAHARIN HASAN"<baharin.hasan@gmail.com> from: "DATAONE SDN... (4 Replies)
Discussion started by: bh_hensem
4 Replies

5. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

6. Solaris

Send an email from Solaris using Linux email server

Hello everyone I have a problem and I need your help: I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server. I need send an email from Solaris servers preferably using Centos4 email server. I have no mail service configured in my Solaris computers (1 Reply)
Discussion started by: aflores
1 Replies

7. UNIX for Dummies Questions & Answers

smbclient print while preserving windows printer settings?

I have successfully gotten AIX to print to a windows shared printer with this command: smbclient -U user%password -W domain -c "print file.ext" the only problem is: I have this print queue set up on the Windows side to overlay an image to all pages. When printing from samba, the overlay... (2 Replies)
Discussion started by: raidzero
2 Replies

8. UNIX for Dummies Questions & Answers

Send email where # is in the email address - Using Unix

Hi All, How do I send an email using malix where email address contains a #. I have a email address like this : #test@test.com I want to send email like malix -s "TEST" #test@test.com < SOMEFILE I tried \# but doesn't work. Please let me know how we can achieve this? I am in... (1 Reply)
Discussion started by: jingi1234
1 Replies

9. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies
Login or Register to Ask a Question