Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Sending mail in UNIX with body and attachment(.txt) using sendmail command Post 302863115 by bakunin on Saturday 12th of October 2013 10:57:20 AM
Old 10-12-2013
Quote:
Originally Posted by KRR
Is there any parameter I need to pass while sending mail from unix to windows?
Not directly: Your problem is missing/wrong line breaks and the reason for this is that UNIX(oid) systems and DOS(-like) systems have different standards for what a line break constitutes. The following:

Code:
line 1
line 2

would be represented by the characters:

Code:
line 1<cr>line 2

in UNICes and by

Code:
line 1<cr><lf>line 2

in DOSses.

The reason for this is that the developers of DOS shied away from implementing printing filters. Instead they adopted a "standard" which could be sent to a printer directly and still print correctly because the control characters necessary for carriage return (<cr>, 0Dh) and line feed (<lf>, 0Ah) were already in the files.

unix2dos (and recode and similar tools) correct just this small detail. In "ftp" you may have noticed the mode "ASCII" and "binary". These modes are about the same difference, in "ASCII" mode line breaks are corrected during transfer, in "binary" the files are passed "as is".

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sending mails with attachment and also some text in mail body

Hi, Can some one help me with the syntax of the mailx that should send an attachment and also some text in the message body together. When I am using the following syntax it is not sending the attachment but only the message body. unix2dos -ascii $REPORTFILE | uuencode $PCFILE | mailx -s... (7 Replies)
Discussion started by: guptan
7 Replies

2. AIX

Command line/Script to send E-mail with HTML body and binary attachment

I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum: I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command... (3 Replies)
Discussion started by: G-Man
3 Replies

3. Shell Programming and Scripting

Attaching file and sending text in body using sendmail command!!

Hello, I need to send with text in the body and 2 files as attachments using sendmail command. i can send only one at a time either attachment or text in body of email. Can any one please help me how to get that? I will be great for any help. Thanks, Sparan (1 Reply)
Discussion started by: sparan_peddu
1 Replies

4. UNIX for Dummies Questions & Answers

Issue on sending a mail with attachment using unix script ?

Issue on sending a mail with attachment using unix script ? Below is my code and is working fine and there is a issue in the attachment, the attachment file printing as a text-encripted message in the mail draft box instead of putting as a attachment (cat $msg; uuencode $attach1 in1.txt ;... (2 Replies)
Discussion started by: gksenthilkumar
2 Replies

5. Shell Programming and Scripting

Not able to attach text in body of email while sending mail with attachment

Hi, We have been trying to send mail with attachment and it is going fine, but when we try to attach a text to the body of the email, we find that the mail is going fine with the body text but the attachment is not going through. We are using ksh. The command that is successfull without the... (6 Replies)
Discussion started by: jmathew99
6 Replies

6. Shell Programming and Scripting

unix mail body with attachment

How can I send mail with attachment in HP-UX I am able to send mail with specific body,but not successful while attaching a file. I am using the below command however it stuck : uuencode test.txt |mailx -s "Subject" <e-mail id> (5 Replies)
Discussion started by: gautamadak
5 Replies

7. UNIX for Dummies Questions & Answers

Sending email with attachment and body

Hi I want to able to attach a file to a email and send it with a body the body of the email is within the "body" file, and the attachment in "atch" if i send like below it will send the email correctly /usr/sbin/sendmail me@you.com< body And when i send the attachment alone... (3 Replies)
Discussion started by: sridanu
3 Replies

8. Shell Programming and Scripting

problem with sending mail from txt file having HTML code via sendmail -t

Hi, i have the following code in shell named as test3.sh.. #!/bin/sh . /home/<user>/.profile export dt=`date "+%d%b%y"` export tim=`date "+%d%b%y %HM:%MM"` cd export WD=`pwd` SID="<sid>" export SID export ORACLE_SID=$SID export ORACLE_HOME=/oracle/$SID/102_64 export... (4 Replies)
Discussion started by: jassi10781
4 Replies

9. Shell Programming and Scripting

Sending attachment using sendmail command

Send_Mail() { C_Date=`date +"%m/%d/%Y"` #Subject="MMDB Load Job Status" for i in `cat $Metafile` do if then email_address=`echo $i | cut -d":" -f2` /usr/lib/sendmail "$email_address" < $Email_File fi done } this is the send mail command i am using .please let me... (1 Reply)
Discussion started by: Alok K Yadav
1 Replies

10. Shell Programming and Scripting

Sending mail with attachment(image) using sendmail in Linux(ksh)

Hi guys, I am trying to send a mail with below command which is working fine. $FilePath_mail have To,From and other information along with mail body which is in HTML format. I want to have image(logo) in the body. So just wanted to send it as an an attachment. /usr/sbin/sendmail -t <... (1 Reply)
Discussion started by: balakrishnaps
1 Replies
unix2dos(1)							   User Commands						       unix2dos(1)

NAME
unix2dos - convert text file from ISO format to DOS format SYNOPSIS
unix2dos [-ascii] [-iso] [-7] [-437 | -850 | -860 | -863 | -865] originalfile convertedfile DESCRIPTION
The unix2dos utility converts ISO standard characters to the corresponding characters in the DOS extended character set. This command may be invoked from either DOS or SunOS. However, the filenames must conform to the conventions of the environment in which the command is invoked. If the original file and the converted file are the same, unix2dos will rewrite the original file after converting it. OPTIONS
The following options are supported: -ascii Adds carriage returns and converts end of file characters in SunOS format text files to conform to DOS requirements. -iso This is the default. Converts ISO standard characters to the corresponding character in the DOS extended character set. -7 Converts 8 bit SunOS characters to 7 bit DOS characters. On non-i386 systems, unix2dos will attempt to obtain the keyboard type to determine which code page to use. Otherwise, the default is US. The user may override the code page with one of the following options: -437 Use US code page -850 Use multilingual code page -860 Use Portuguese code page -863 Use French Canadian code page -865 Use Danish code page OPERANDS
The following operands are required: originalfile The original file in ISO format that is being converted to DOS format. convertedfile The new file in DOS format that has been converted from the original ISO file format. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ SEE ALSO
dos2unix(1), ls(1), attributes(5) DIAGNOSTICS
File filename not found, or no read permission The input file you specified does not exist, or you do not have read permission. Check with the SunOS command, ls -l (see ls(1)). Bad output filename filename, or no write permission The output file you specified is either invalid, or you do not have write permission for that file or the directory that contains it. Check also that the drive or diskette is not write-protected. Error while writing to temporary file An error occurred while converting your file, possibly because there is not enough space on the current drive. Check the amount of space on the current drive using the DIR command. Also be certain that the default diskette or drive is write-enabled (not write-pro- tected). Notice that when this error occurs, the original file remains intact. Translated tmpfile name = filename. Could not rename tmpfile to filename. The program could not perform the final step in converting your file. Your converted file is stored under the name indicated on the second line of this message. SunOS 5.10 14 Sep 2000 unix2dos(1)
All times are GMT -4. The time now is 09:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy