How to send mail from the command line?

1
The mail can't arrive, because it is bouncing due to misconfiguration. Lets follow along:

... postfix/pickup[6188]: B1C4EAC44D: uid=0 from=

Postfix receives the mail from sendmail

... postfix/cleanup[6194]: B1C4EAC44D: message-id=

Postfix assigns a message-ID

... postfix/qmgr[6189]: B1C4EAC44D: from=, size=297, nrcpt=1 (queue active)

Postfix accepts the message into the queue. Notice the Envelope From is "root@gmail.com". Your machine is named gmail.com, and this is incorrect.

... postfix/local[6196]: B1C4EAC44D: to=, relay=local, delay=0.05, delays=0.03/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "davidtuti")

Postfix attempts to deliver the mail via the "local" mail delivery agent, but finds there is no such user "davidtuti". This means you do not have a davidtuti user in /etc/passwd or a same named alias in /etc/postfix/aliases. Since postfix is configured to be gmail.com, it considers this address local.

The...

0 0
2

While working with the command line, there are times when you might want to manually send an email to communicate one-liner information, say a complex command or an important note to yourself or a friend. Normally, that requires you to open a web browser, log in to your email account, frame an email containing the required information, and then send it.

That’s too long of a process for a small thing, isn’t it? What if you could do that from the command line itself? Yes, it is possible, and we’ve already discussed a couple of ways to do that in Linux. In this article, we will discuss three more ways to send email from the command line in Linux.

Sendmail, as you might know, is the classical SMTP server from the world of UNIX. It usually comes pre-installed on many Linux distributions, but if that’s not the case with your Linux box, you can easily install it from standard repositories. For example, users of Debian-based systems, like Ubuntu, can download and install it...

0 0
3

Want to learn how to send email from the Linux command line? Follow this step by step tutorial to learn how to do so.

Don't forget to check out our site http://howtech.tv/ for more free how-to videos!
http://youtube.com/ithowtovids - our feed
http://www.facebook.com/howtechtv - join us on facebook
https://plus.google.com/1034403827176... - our group in Google+

In this tutorial, we will teach you how to send email from the Linux command line. This tutorial will walk you through from initially setting up the configuration file for email purposes to eventually viewing the email in the inbox. In Linux, you can send email from the command line.

Step 1 -- Install ssmtp client

First of all, let's open up the terminal application and type:
sudo apt-get install ssmtp and then hit the enter key.
This will install the ssmtp client on your server.

Step 2 -- Continue with the installation

Once you are prompted, enter y to...

0 0
4

SendItQuiet is a software for Windows that lets you send email from command line. It can also let you attach files and supports SSL connection. This software can be best to use for sending bulk emails from command line via a batch file. This software is capable of sending files as an attachment and supports sending emails to multiple recipients which can be supplied to the software as a parameter.

You would not require any kind of technical knowledge to use this tool to send email from command line. This software runs without any installation and can be used directly from the folder it is downloaded to. Read on to find out how to use this software.


Sponsored Links

Now, if you thought that it would be too difficult for you to understand this software then let me tell you that it is very easy to use this software.

Hope you know how to open up the command prompt but just so if you don’t know, press Windows Key (Key with Windows Logo) + R. The...

0 0
5

If you are like me, you really like the command line.

And sending email while working on the command line, is sometimes a good idea, I use it to send notes to myself, and sometimes to send configuration files as attachments.

Is also good to have an option configured to send emails from the command line, as a way to send messages from scripts.

I will show you now how to use mutt and gmail to enable a Linux computer to send email.

Install mutt

Arch Linux

sudo pacman -S mutt

Ubuntu

sudo aptitude install mutt

Configure mutt

To configure it, we need to create ~./muttrc and put inside the file this contents

set from = "user@gmail.com" set realname = "Guillermo Garron" set imap_user = "user@gmail.com" set imap_pass = "password" set folder = "imaps://imap.gmail.com:993" set spoolfile = "+INBOX" set postponed ="+[Gmail]/Drafts" set header_cache =~/.mutt/cache/headers set message_cachedir =~/.mutt/cache/bodies set...
0 0
6

Overview

Sometimes you might need or want to send email from the command line. You might generate a report from a database or your application and want to send the generated report via email. Assuming that the report is generated manually via a scipt and invoked using crontab.

In this tutorial we'll learn how-to install MSMTP and Mutt. We'll use MSMTP to relay our email to Gmail. If you want to follow this tutorial using Gmail a email account please create a new email address to be used on your server and don't use your current gmail account, one of the reasons is that the password to the Gmail account will be stored in plain text by default. You can use pgp to store your password securely. Another reason is that the account that you will use to send email from the server might get locked due to the different location between you and the server.

If you find difficulties logging in from your server to Gmail, you might want to follow steps provided in Google...

0 0
7

The Linux command line can be very powerful once you know how to use it. You can parse data, monitor processes, and do a lot of other useful and cool things using it. There often comes a need to generate a report and mail it out. It could be as simple a requirement as a notification that the day’s backup went through fine, or did not. I’ll help you get started with sending mails from the Linux command line and in shell scripts. We will also cover sending attachments from the command line. We will begin with the “mail” command.

MAIL

First run a quick test to make sure the “sendmail” application is installed and working correctly. Execute the following command, replacing “you@youremailid.com” with your e-mail address.

# mail -s “Hello world” you@youremailid.com

Hit the return key and you will come to a new line. Enter the text “This is a test from my server”. Follow up the text by hitting the return key again. Then hit the key combination of Control+D to...

0 0
8
...
0 0
9

Most of the time you shouldn't need to configure an SMTP server you can simply use mail from the commandline (if it's not already present, install with sudo apt-get install mailutils). (Or if you're on a server where sendmail is configured, etc)

marco@dagobah:~$ mail -v marco.ceppi.use@gmail.com Subject: Hello World! This is an email to myself. Hope all is well. . Cc:

You terminate messages with a single . on line. That's when mail will prompt you for Cc: enter the information (or leave blank) and mail will then print out additional information on what it is attempting to do, as well as detailing the processing of connecting, transmitting, and receiving data from the mail...

0 0
10

Send mails from command line

The mail command is an essential one that should be available on any linux server so that various services and other web applications can generate and transmit emails.

In a previous post on mail command we saw how the mail command can be used to send emails from the command line on your linux server.

In this tutorial we shall be using an enhanced version of the mail command. Its called mailx (or just mail when installed), and it can do many more things than what the older mail command from gnu mailutils package can do.

How does it work

The mail/mailx command needs a local smtp server (MTA) running in order to deliver the emails. THe route taken by the email is somewhat like this -

mail -> sendmail -> local MTA -> recipient MTA [Inbox]

The recipient MTA would be gmail's smtp server if your recipient is someone at gmail.com for instance. For the local MTA, you need to install an smtp server like Postfix. A...

0 0
11

As a System admin, sometimes we need to send mails to users or someone else from the server and for that we used to go with a web based interface to send email, is it really that handy ? Absolutely No.

Mutt Command Line Email Client

Here in this tutorial, we’ll be using the mutt (a terminal email client) command to send email from command line interlace.

What is Mutt?

Mutt is a command line based Email client. It’s a very useful and powerful tool to send and read mails from command line in Unix based systems. Mutt also supports POP and IMAP protocols for receiving mails. It opens with a coloured interface to send Email which makes it user friendly to send emails from command line.

Mutt Features

Some other important features of Mutt is as follows:

Its very Easy to install and configure. Allows us to send emails with attachments from the command line. It also has the features to add BCC (Blind carbon copy) and CC (Carbon copy) while sending mails. It...
0 0
12

Send mail via SMTP servers

The default mail command on the Linux terminal, uses the local smtp server (mta) on port 25 to transmit emails. However at times you need to specify an external smtp server to use for sending mails.

For example you have just setup an smtp server, like Postfix or Exim, then you would want to test it out to check if it is receiving and relaying emails properly or not.

Being able to send mails from command line using this external smtp server is quick rather than having to setup a mail client like Thunderbird on your local machine.

1. mailx command

The mailx command is available from many different packages like mailutils, heirloom-mailx etc. We shall be using heirloom-mailx since it allows to specify smtp connection details in a single command and issue and email quickly.

$ sudo apt-get install heirloom-mailx

Now send an email with an external smtp server like this -

echo "This is the message body and...
0 0
13

We all know the importance of emails these days for information transfer. There are many free emails service providers which we used for use like Gmail, Yahoo, RediffMail etc, which provides a web interface for sending and receiving emails. But this is not enough, some times we also required to send emails from system command line. This article will provides you the ways to send emails from Linux command line. This is useful for sending email through our shell scripts, cron jobs etc.

There are various ways to send emails from command line but here I am sharing few options used by most users. You can use anyone option given below to send email from Linux command line.

1. Using ‘sendmail’ Command

Sendmail is a most popular smtp server used in most of Linux/Unix distribution. sendmail allows to send email from command line. Use below instructions to send email using ‘sendmail‘ command.

Create a file using following content.

[[email protected]...
0 0
14

The Linux command line can be very powerful once you know how to use it. You can parse data, monitor processes, automate backups and do a lot of other useful and cool things using it. There often comes a need to generate a report and mail it out. It could be as simple a requirement as a notification that the day’s backup went through fine, or did not. I’ll help you get started with sending mails from the Linux command line and in shell scripts. We will also cover sending attachments from the command line. We will begin with the “mail” command.

MAIL

First run a quick test to make sure the “sendmail” application is installed and working correctly. Execute the following command, replacing “you@youremailid.com” with your e-mail address.

# mail -s “Hello world” you@youremailid.com

Hit the return key and you will come to a new line. Enter the text “This is a test from my server”. Follow up the text by hitting the return key again. Then hit the key...

0 0
15

Send a Plaintext body email with one plaintext attachment with mailx:

( /usr/bin/uuencode attachfile.txt myattachedfilename.txt; /usr/bin/echo "Body of text" ) | mailx -s 'Subject' youremail@gmail.com

Below is the same command as above, without the newlines

( /usr/bin/uuencode /home/el/attachfile.txt myattachedfilename.txt; /usr/bin/echo "Body of text" ) | mailx -s 'Subject' youremail@gmail.com

Make sure you have a file /home/el/attachfile.txt defined with this contents:

Government discriminates against programmers with cruel/unusual 35 year prison sentences for making the world's information free, while bankers that pilfer trillions in citizens assets through systematic inflation get the nod and walk free among us.

If you don't have uuencode read this: http://unix.stackexchange.com/questions/16277/how-do-i-get-uuencode-to-work

On Linux, Send HTML body email with a PDF attachment with sendmail:

Make sure you have ksh installed: yum info...

0 0