Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to get a log file sent to my e-mail from my Linux RH server.
I run thing command
cat smtest.txt | sendmail -t
smtest.txt:
to : *******@gmail.com
cc : *****@foodconnex.com
from : Your server name
subject : Test mail
TESTING 1 2 3 sendmail!!
How can I send an attachment with this command or somehow cat the file into smtest.txt where the body is.
I am open to other ideas, if there is a better sendmail command to run please let me know!
Above post is absolute way to send attachments from command line. But if you want to know another way, try uuencode command to send emails with attachments.
Take a look at this. http://www.cyberciti.biz/faq/howto-u...l-attachments/
I have a log called ai.log, so how would I attach that? Also what is in attachment.file and message-body.txt?
mutt -s "AI Log" *******@gmail.com -a ????????????
You should attach the logfile after the -a switch.
In message-body.txt you can put some text you want your recipient to read. If don't to, replace it with /dev/null
Code:
mutt -s "AI Log" *******@gmail.com -a ai.log < /dev/null
You should attach the logfile after the -a switch.
In message-body.txt you can put some text you want your recipient to read. If don't to, replace it with /dev/null
Code:
mutt -s "AI Log" *******@gmail.com -a ai.log < /dev/null
I run the command I found before
cat smtest.txt | sendmail -t
vi smtest.txt
to : *******@gmail.com
from : Your server name
subject : Test mail
I receive the e-mail,
but when I run
mutt -s "AI Log" ******@gmail.com -a ai.log < body.txt
I have a log called ai.log, so how would I attach that? Also what is in attachment.file and message-body.txt?
mutt -s "AI Log" *******@gmail.com -a ????????????
When in doubt, read the man page and learn the options you're given. You should be doing that before running any command off of an internet website or example. It's a simple matter of security/integrity for your own system.
I do not get an email either, it does come back saying...
you have new mail in /var/spool/mail/root
Check the logs (/var/log/maillog) to see what happens
If you don't get any mail, but mail has left your server, chances are that's it's finished into the spam folder
But the problem now is it is coming in as an "unknown sender" which then it keeps dumping into my spam folder. I have the from but it doesn't seem to be looking at that.
Does anyone have an idea with the command above so when my gmail gets the e-mail the from is from somewhere and not unknown sender?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.