Hi ,
I am using mailx command for sending the mails. Rightnow I am sending the attachment (by using uuencode $filename) as a seperate mail.I wanna send the attachment also with the same mail.
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 04:37 AM..
Reason: addition of a script to call . . .
Thanks man, this is great help !! It solved my purpose too to send a mail with an attachment and text as an option.
If I want to attach more then one file to the same mail then what would be the syntax ???
FYI: In case you didn't already know it, the first file named in the uuencode command is the source file. Include the path if necessary. The second file is the name that will be used when the recipient extracts it from their email.
FYI: In case you didn't already know it, the first file named in the uuencode command is the source file. Include the path if necessary. The second file is the name that will be used when the recipient extracts it from their email.
Hey,
Thanks for the reply.
One more question regarding the same topic.
How to send a mail which contains the text as well as the attachment file ?
Note :The text to the mail could be hardcoded or could be taken from a file.
FYI: In case you didn't already know it, the first file named in the uuencode command is the source file. Include the path if necessary. The second file is the name that will be used when the recipient extracts it from their email.
Hey Guys,
Thanks, I got the answer !!
Thanks for visiting !!
Varun.
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)
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)
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)
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,
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)
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)
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
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)
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)
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)