Mutt command error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mutt command error
# 1  
Old 11-05-2015
Mutt command error

Hello there,

I am using "mutt" command to send e-mails.


Code:
mutt -s "Mail subject line" $( printf -- '-a attachment_name') < "mail body file" "e-mail id" 

I wish to change the name of the attachment by appending the date to it.
Something like "attachment_name_$DATE.html" in the mutt command.

However, I am getting the error as :

Can't stat attachment_name_$DATE.html: No such file or directory
attachment_name_$DATE.html: unable to attach file.



Could you please help.

Thanks,
Haider
# 2  
Old 11-05-2015
You know that shell expansion doesn't work between single quotes?
# 3  
Old 11-05-2015
Hello RudiC,

Could you please help me with the correct command.

Thanks,
Haider
# 4  
Old 11-05-2015
Try double quotes in lieu of the single quotes.
# 5  
Old 11-05-2015
Hello

Now I do not get any attachment in the mail.

the code being used is :

Code:
mutt -s "Mail subject line" $( printf -- "'-a attachment_name'") < "mail body file" "e-mail id" 

Thanks,
Haider
# 6  
Old 11-05-2015
In above, get rid of the single quotes entirely.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mutt command email body

Hi Team, While sending the email using the mutt command, mail body not appearing properly and attachment it is showing without line breaks and i used the CSS Style (nowrapper )it is working fine. in this case how to handle the email body, please help me. (1 Reply)
Discussion started by: bmk123
1 Replies

2. Shell Programming and Scripting

How to send the log as it is through mailx or mutt command?

Hi, I am able to send the mail with attachment through mailx/mutt command.But i am seeing the log file statements all together when i tried to open from my outlook. log file have the details like below aaa bbb ccc when i tried to open it from my outlook after receiving the mail attachment... (1 Reply)
Discussion started by: Samah
1 Replies

3. UNIX for Beginners Questions & Answers

Exec command with mutt - turn on & off?

Hi Folks - Quick question around the exec command again. At the end of my script, I check for specific error codes that are returned from a process I execute within the shell script. Based on the error code, I send an email. Do I need to turn off exec feature prior to send each email so... (5 Replies)
Discussion started by: SIMMS7400
5 Replies

4. UNIX for Dummies Questions & Answers

Mutt command - email body with out file name

Hello All, I know we can put body inside a mail using -i option for specifying the file which contains body message, is there an option for me to specify body content instead of a file specification only using mutt? Below is not working and i don't see any options in manual page! ... (4 Replies)
Discussion started by: Ariean
4 Replies

5. UNIX for Advanced & Expert Users

HTML and attachment using mutt command

Hi All, I want to attach the file as well send html content in the mail body using mutt command or any other command.(uuencode is not present). Please help me. Thanks in advance (1 Reply)
Discussion started by: arukuku
1 Replies

6. Shell Programming and Scripting

How to change the sender's name or E-mail address in mutt command

Can any one help me in this ??? How to change sender's name or email address in Mutt command??? (4 Replies)
Discussion started by: sarathi
4 Replies

7. AIX

Using mutt from command line or script

Hello, I am attempting to send emails from AIX 5.2 using either the mailx command or mutt. When I use mutt: mutt -a jim.txt -s "Test Email" me@mydomain.com It sends the attachment, but it forces me into the interactive menu. When I use mailx: cat data.txt | uuencode... (10 Replies)
Discussion started by: jyoung
10 Replies

8. Ubuntu

How to use GnuPG with MUTT, getting error!

I am using MUTT and I have configured my gmail account in it. I want to use GnuPG(gpg) in it. But even after importing I get key not found error while sending. Please help me for this problem. ---------- Post updated at 11:26 PM ---------- Previous update was at 07:48 AM ---------- This is... (0 Replies)
Discussion started by: nixhead
0 Replies

9. Shell Programming and Scripting

How to attach multiple .csv files using mutt command

I need to attach all files starting with 'BusinessReport' using mutt command. It could be any number of files in that directory, say BusinessReport_01, BusinessReport_03, BusinessReport_04 etc. Is there a way to attach all files where filename like BusinessReport_* and sent it using mutt... (2 Replies)
Discussion started by: Jassz
2 Replies

10. Shell Programming and Scripting

How does mutt command pick senders Details

Hi All, We use mutt in one of our scripts to send files as a part of a batch job . The command works nicely but i want to know from where does mutt pick the sender details. As the sender id is different if i use mutt and Mail utility. I can not change the command to mail as it is a part of the... (1 Reply)
Discussion started by: amit1_x
1 Replies
Login or Register to Ask a Question