All Questions
Tagged with mail-command shell-script
17 questions
0
votes
0
answers
38
views
mail sent in encoded format without any attachments
I am trying to migrate a certain script from AIX to Linux and having issues with the mail functionality. The rest of the script works fine, but the mail function is sending encoded mails with no ...
0
votes
0
answers
787
views
Cannot get shell script to send error message as mail body
I have a shell script I want to email me when a particular command fails and send along the error message. Either it doesn't send an email at all, or it sends an email with an attachment named ...
1
vote
1
answer
959
views
Override hostname for mail(1) in a shell script
I'm trying to quickly send some stuff to myself from my MacBook, but I'm having issues with my server rejecting the SMTP connection due to the unqualified domain name in the from field.
I've tried ...
1
vote
1
answer
2k
views
How to use emojis on the subject line of mail?
I am writing a shell script to setup a few servers and once it is done, it will send an email to our help desk letting us know that the server is ready to be used.
I would like to use the following ...
0
votes
3
answers
3k
views
How to attach a file while sending an email through shell script?
I used the following code to send an email via shell script.
Code: mail -s "subject" [email protected] <<< "Body of the mail"
It worked. But I want to attach a file while sending the ...
2
votes
2
answers
2k
views
Create a script to check the date, time and string and trigger a mail
Need to create a script where
I want to take the last few lines of the log file and check that the last line with Start Date contains the date of today and the time 17:00:xx and is followed by xxxxx ...
2
votes
1
answer
4k
views
-c and -b options not working in mailx in ubuntu
I was trying to send a mail from the shell script using the command
mailx -s "TEST MAIL" -c "user_name ..." user<message.txt
but it generates an error as unrecognized option -c ,the same happens ...
0
votes
1
answer
140
views
how to send lines/messages to maillog file [closed]
under /var/log , we can see the following maillog files
-rw------- 1 root root 11733421 Aug 5 03:47 maillog-20180805
-rw------- 1 root root 15566137 Aug 13 03:16 maillog-...
0
votes
1
answer
3k
views
mutt is changing the content in body
I have a text file with multiple lines in content . But when I am sending it in mail all the lines are coming in one line in email as part of body of mail.
But when I insert empty line in content ...
1
vote
0
answers
7k
views
How to check whether I can send mail from my Linux server?
When I tried using mail or mailx with -r -s -a and other options, I am not able to send mail. Is there anything I need to check before sending mail from Linux server?
When I tried to see help for ...
0
votes
1
answer
513
views
Checking for mails
I recently started using mails via UNIX.
I would like to create a script , that would write (every time I log in ) something like
"The content of your mailbox has changed since last checkup"
or
"...
1
vote
2
answers
2k
views
Trying to direct variable contents into command gives Ambigious Redirect
I'm trying to write a script which tests the http response from various Node servers I have running and which then emails me if any respond with a 502 error from Nginx (meaning one or more server has ...
-1
votes
2
answers
219
views
Script not running! Also how to attach timestamp in mail?
I have the following bash script...
#!/bin/bash
# Delete JUNK temp folder
if [ -d JUNK/FOLDER/PATH ]
then
rm -rf JUNK/FOLDER/PATH
echo "Cleansed JUNK directory successfully!"
/usr/bin/mail -s ...
8
votes
3
answers
2k
views
Executing mail command from inside a function causes a "fork bomb"
When I try to execute mail from inside a function in a bash script it creates something similar to a fork bomb. To clarify, this creates the issue:
#!/bin/bash
mail() {
echo "Free of oxens" | ...
2
votes
1
answer
5k
views
Trying to send multiple text attachments via mail message
Running this script on: "Red Had Enterprise Linux Server release 5.11 (Tikanga)"
Mail is: version 8.1 6/6/93 (appears quite old).
Have tried various things and cannot seem to get this to work..
...