Sponsored Content
Full Discussion: mail or mailx attachment
Top Forums UNIX for Dummies Questions & Answers mail or mailx attachment Post 65536 by brettmartin99 on Monday 7th of March 2005 03:50:15 AM
Old 03-07-2005
Quote:
Originally Posted by RTM
You need to be more specific about your problem:


If you use mailx -s "test" myself@somedomain.com < /etc/hosts
do you get the email with a subject as 'test'?
If you use mailx -s "test" myself@somedomain.com < uuencodefile, what happens?

Please explain further on stating "mailx does not attach the file" versus "substituting mailx for mail...attaches the file"
To clarify:

I want to send email from UNIX with an attachment (a csv) and a subject, we are using HP-UX 11.11.

When I use the mailx command from my original post the file I am trying to attach does not appear as an attachment, it is embeddded within the message, and the subject is shown.

When I use mail the file does appear as an attachment in Outlook, but I can only get this to work when I don't specify a subject, as below:

mail me@mydomain < uuencoded file

If I specify a subject the error is returned:

mail: illegal option -- s
usage: mail [+] [-epqr] [-f file]
mail [-dt] persons

For the tests you suggested: Using the first command line I get the word test in the subject and the hosts file in the message area.

The second test has the same result as the first.

Cheers

Brett.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

mailx commannd - Mail and Attachment in same mail

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. (6 Replies)
Discussion started by: sharif
6 Replies

2. Shell Programming and Scripting

Problem with Mailx command to send mail with attachment

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)
Discussion started by: viswanatharv
5 Replies

3. UNIX for Advanced & Expert Users

how to send file as attachment using mail or mailx

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)
Discussion started by: kieranfoley
1 Replies

4. Shell Programming and Scripting

Adding an attachment as an attachment to mailx

I don't want the attachment embedded in the mail. I would like a file attached. When I do mailx -s "Report, `date +'%D %r` " -r "Notifications" bob@bob.com < /usr/local/bin/myreport.log> /dev/null It gets embedded in my email. I want a file attachment. How do I do that? (2 Replies)
Discussion started by: guessingo
2 Replies

5. Shell Programming and Scripting

Mailx: How to send a attachment using mailx command

Hi All, Can anyone please provide the command for sending an mail with attachment using mailx command. Thanks in Advance :) Regards, Siram. (3 Replies)
Discussion started by: Sriram.Vedula53
3 Replies

6. HP-UX

mailx with -m attachment corrupted

mailx with -m command sending emails with attachments correctly to all users except users who have email on microsoft exchange server. They are receiving attachments as garbled text in mail body (5 Replies)
Discussion started by: sankalpag
5 Replies

7. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

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)
Discussion started by: mani_isha
0 Replies

8. Shell Programming and Scripting

send attachment and body in one mail using mailx

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)
Discussion started by: ashwin3086
4 Replies

9. Solaris

mailx with attachment

Hi, When i used below command, i am able to send mail mailx -s "Testing mail working or not " babu.sudhakar@ymail.com" but if i want send attachment with mail,which syntax i need to follow to send a file as attachment. (3 Replies)
Discussion started by: sridhardwh
3 Replies

10. UNIX for Beginners Questions & Answers

Need help sending attachment via mailx

Hello, I am new to the Unix thing, and I am having trouble sending attachments via shell client putty through mailx. The command I use is $ mailx -s "Subject" user@blah.com < attachment.txt but everytime I do that it would say Cannot open attachment.txt I have the file save to my computer... (5 Replies)
Discussion started by: mrobin20
5 Replies
MB_SEND_MAIL(3) 							 1							   MB_SEND_MAIL(3)

mb_send_mail - Send encoded mail

SYNOPSIS
bool mb_send_mail NULL NULL (string $to, string $subject, string $message, [string $additional_headers], [string $additional_parame- ter]) DESCRIPTION
Sends email. Headers and messages are converted and encoded according to the mb_language(3) setting. It's a wrapper function for mail(3), so see also mail(3) for details. PARAMETERS
o $to - The mail addresses being sent to. Multiple recipients may be specified by putting a comma between each address in $to. This parameter is not automatically encoded. o $subject - The subject of the mail. o $message - The message of the mail. o $additional_headers (optional) - String to be inserted at the end of the email header. This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF ( ). Note When sending mail, the mail must contain a From header. This can be set with the $additional_headers parameter, or a default can be set in php.ini. Failing to do this will result in an error message similar to Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing. The From header sets also Return-Path under Windows. Note If messages are not received, try using a LF ( ) only. Some Unix mail transfer agents (most notably qmail) replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with RFC 2822. o $additional_parameter -$additional_parameter is a MTA command line parameter. It is useful when setting the correct Return-Path header when using send- mail. RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.0.0 | | | | | | | The Content-Type and Content-Transfer-Encoding | | | headers may be redefined as of PHP 5.0.0. Before | | | this time, the values defined by mb_language(3) | | | are always used. | | | | +--------+---------------------------------------------------+ SEE ALSO
mail(3), mb_encode_mimeheader(3), mb_language(3). PHP Documentation Group MB_SEND_MAIL(3)
All times are GMT -4. The time now is 08:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy