mailx

mutt command with multiple attachments in single mail unix

若如初见. 提交于 2019-12-03 08:37:58
问题 My requirement is to attach all the .csv files in a folder and send them in a single mail. Here is what have tried, mutt -s "subject" -a *.csv -- abc@gmail.com < subject.txt The above command is not working (It's not recognizing multiple files) and throwing the error Error sending message, child exited 67 (User unknown.). Could not send the message. Then I tried using multiple -a option as follows, mutt -s "subject" -a aaa.csv -a bbb.csv -- abc@gmail.com < subject.txt This works as expected.

Read lines from File in Bash and parse words into variables for mailx parameters

旧时模样 提交于 2019-12-01 19:54:24
I have a bash script which reads lines from a text file with 4 columns(no headers). The number of lines can be a maximum of 4 lines or less. The words in each line are separated by SPACE character. ab@from.com xyz@to.com;abc@to.com Sub1 MailBody1 xv@from.com abc@to.com;poy@to.com Sub2 MailBody2 mb@from.com gmc@to.com;abc@to.com Sub3 MailBody3 yt@from.com gqw@to.com;xyz@to.com Sub4 MailBody4 Currently, I am parsing the file and after getting each line, I am storing each word in every line into a variable and calling mailx four times. Wondering if is there is an elegant awk/sed solution to the

how to send an email via mailx with enclosed file

十年热恋 提交于 2019-11-30 14:00:13
问题 I need to sent a file via mailx or mail, but I wat to sent it as attachment not in the body message. Is there any way how to do it ? Eventually is there any other tool in solaris which can be used for such as procedure ? Thanks 回答1: You can attach files to mailx using -a like so echo "this is the body of the email" | mailx -s"Subject" -a attachment.jpg Someone@Domain.com so long as your in the same directory as your attachment that should work fine. If not you can just state the directory

how to send an email via mailx with enclosed file

本秂侑毒 提交于 2019-11-30 12:17:22
I need to sent a file via mailx or mail, but I wat to sent it as attachment not in the body message. Is there any way how to do it ? Eventually is there any other tool in solaris which can be used for such as procedure ? Thanks Jeff You can attach files to mailx using -a like so echo "this is the body of the email" | mailx -s"Subject" -a attachment.jpg Someone@Domain.com so long as your in the same directory as your attachment that should work fine. If not you can just state the directory like ` samachPicsFolder/samachpic.jpg If your mailx doesn't support the -a option and you don't have

linux mail < file.log has Content-Type: application/octet-stream (a noname attachment in Gmail)

时间秒杀一切 提交于 2019-11-30 08:45:48
I've been using mail -s "here is a log file" "person@example.com" < log/logfile.log Which used to come through with headers: User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit But now the files are longer I'm getting noname attachments because with this: User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: application/octet-stream Content-Transfer-Encoding: base64 So if all else fails, check the manual man mail ... NAME mailx - send and receive Internet mail SYNOPSIS mailx [-BDdEFintv~] [-s

How to set the From email address for mailx command?

て烟熏妆下的殇ゞ 提交于 2019-11-29 23:44:56
I am working on a KornShell (ksh) script running on a Solaris server that will send out an email when and error condition is met. I am sending the email via mailx . Question: How do I set the "From" email address on the mailx command? Current Code: echo ${msg_txt} | mailx -s "Script Failure" ${to_email} Note: The command works fine, however, the "From" is the name of the user I am running the script as and I would like for this to another email address. How would I accomplish this? You can use the "-r" option to set the sender address: mailx -r me@example.com -s ... The "-r" option is invalid

linux mail < file.log has Content-Type: application/octet-stream (a noname attachment in Gmail)

余生颓废 提交于 2019-11-29 11:59:39
问题 I've been using mail -s "here is a log file" "person@example.com" < log/logfile.log Which used to come through with headers: User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit But now the files are longer I'm getting noname attachments because with this: User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: application/octet-stream Content-Transfer-Encoding: base64 So if all else fails, check

How to set the From email address for mailx command?

China☆狼群 提交于 2019-11-28 20:53:09
问题 I am working on a KornShell (ksh) script running on a Solaris server that will send out an email when and error condition is met. I am sending the email via mailx . Question: How do I set the "From" email address on the mailx command? Current Code: echo ${msg_txt} | mailx -s "Script Failure" ${to_email} Note: The command works fine, however, the "From" is the name of the user I am running the script as and I would like for this to another email address. How would I accomplish this? 回答1: You

Mailx send html message [duplicate]

烂漫一生 提交于 2019-11-26 14:43:15
This question already has an answer here: Sending HTML mail using a shell script 11 answers How do I send a file as an email attachment using Linux command line? 26 answers I want to send a html message with Mailx. When I try the following command mailx -s "Subject" user@gmail.com < email.html I get the content of email.html in plain text. In the message the header Content-Type is set to text/plain. The -a option tries to send a file so I didn't find out how to modify the header. This answer almost worked, it sets well the Content-Type to text/html but doesn't substitute the default Content

Mailx send html message [duplicate]

荒凉一梦 提交于 2019-11-26 05:56:44
问题 This question already has an answer here: Sending HTML mail using a shell script 12 answers How do I send a file as an email attachment using Linux command line? 26 answers I want to send a html message with Mailx. When I try the following command mailx -s \"Subject\" user@gmail.com < email.html I get the content of email.html in plain text. In the message the header Content-Type is set to text/plain. The -a option tries to send a file so I didn\'t find out how to modify the header. This