You have to include the following lines in the header of the email to have the file go as an attachment:
And you will probably have to not use mailx and use sendmail with a command like:
But, for that to work, the file, emailfilename has to have a From: line, a Date: line and a Subject: line. There has to be a blank line after these header lines, the ones above, and the start of the data.
Here's a commandline script I wrote for AIX, but which should work just about anywhere you have access to sh (bash, ksh, sh):
HTH
Last edited by kpearson; 02-23-2008 at 03:37 AM..
Reason: addition of a script to call . . .
I have used the forum to determine the format required to send attachments from hp-ux 11. the problem I have is that using mailx does not attach the file, but subsititing mailx for mail on the command line attaches the file but i'm not able to specify a subject?
The attachment has been convert... (3 Replies)
Hi,
I am using mailx command to send a mail with attachment. It's working fine, but with attachment I am getting one extra attachment like (ATT00131.txt). I have tried to use unix2dos command also. But still I am getting the extra attachment.
I am using the following code:
subject="temp... (5 Replies)
Hi
Could someone help me with the details on how to send an attachment through mail in unix.
I have an html file in my unix machine and I want this to be send to some mail id, plese help with the steps.
Regards
Ajay (2 Replies)
I have a need to send a file from the unix command line to be sent as an attachment. Is this possible? That is when I open my outlook email I need to file to appear as an attachment.
Also, is there a way to use the mail binary (not mailx) to modify the "reply address". mailx -r works but I need... (1 Reply)
Hi
The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment .
cat Employee.sql
SET VERIFY OFF
SET PAGESIZE 200
SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD... (0 Replies)
Hi,
Our requirement is to send an attachment and content in a single mail. I am using the below command to send attachement.
---------------------
(uuencode $exp_file $exp_file) |mailx -s "$email_subject" $EmailRecipients
--------------------
I m not able to send any message in the... (4 Replies)
i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail.
actually i am trying to automate the high... (2 Replies)
Hi All,
I am trying to send a mail from linux server but could'nt able to send the mail.
I tried the below syntax's so far but no luck.
mail -s “Hello world” abc@xyz.com < /usr/g/txt.log
cat "txt.log" | mailx -s "Hello world" abc@xyz.com
mailx -s “Hello world” abc@xyz.com <... (2 Replies)
Whats the difference between mail and mailx?
I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL)
... (1 Reply)
I am having trouble getting mail to work on a red hat server. At first I was getting this message.
Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused
Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies
LEARN ABOUT DEBIAN
crashwrite
CRASHWRITE(1) CrashMail CRASHWRITE(1)NAME
crashwrite - Creates PKT file from text file
SYNOPSIS
crashwrite DIR directory [FROMNAME string] [FROMADDR node] [TONAME string] [TOADDR node] [SUBJECT string] [AREA area] [ORIGIN origin] [TEXT
filename] [NOMSGID] [FILEATTACH] [PKTFROMADDR node] [PKTTOADDR node] PASSWORD [string]
DESCRIPTION
CrashWrite reads a text file and creates a .pkt file that can be processed by CrashMail. This can be used to post announcements and other
messages in areas. The best way to use CrashWrite is to let it generate packets in a separate directory and then toss them with TOSSDIR
NOSECURITY.
There are many keywords for CrashWrite. All keywords are optional except for DIRECTORY. If you do not enter a keyword, a default value will
be used.
OPTIONS
FROMNAME string
FROMADDR node
TONAME string
TOADDR node
SUBJECT string
Use these keywords to set the header of the message. You only need to enter TONAME and TOADDR for netmails.
PKTFROMADDR node
PKTTOADDR node
Use these if you want to set the origin and destination address of the packet to something other than the origin and destination
address of the message inside the packet. If you do not specify these keywords, FROMADDR and TOADDR will be used for the packet as
well.
PASSWORD string
You can use this keyword to set a password for the packet. The maximum length of the password is eight characters.
AREA area
The area the message should be posted in. If you do not enter an area, the message will be sent as a netmail.
ORIGIN origin
The origin line for the message. This keyword has no effect for netmail messages.
DIR directory
The directory where the packet should be placed.
TEXT filename
The name of a text file that should be included as the message text.
NOMSGID
Prevents CrashWrite from adding a MSGID line.
FILEATTACH
Sets the file-attach flag for netmails. The filename should be put in the subject line.
SEE ALSO crashmail(1)AUTHOR
CrashMail is written by Johan Billing <billing@df.lth.se>
This manual page was written by Peter Karlsson <peter@softwolves.pp.se>
Johan Billing 1999-08-01 CRASHWRITE(1)