How to configure and send email from cygwin

1. You need to install a package called “email” in cygwin

Step1. Run cygwin setup.exe

Step 2. When the setup prompts to choose, select “Install from internet”

Choose Direct connect

Step 3. When prompted, choose the download site. Most of the sites I tried are still active so just pick one.

Step 4. Search for package called “email” -> select it for installation.
Once selected & confirm, the package is now going to be installed. Let the installation completes and voila, you have email capability in cygwin.

2. Before using “email”, you need to set it up so it knows whether to use “sendmail” (another unix built-in functionality to deliver emails) or using a separate smtp server .
Since “sendmail” is missing in cygwin , I go with option 2, config separate smtp for “email” to work.
=> launch cygwin, then type “email-config” . This will prompt you a series of questions to configure the mail server for “email” .
=> Please enter your From: name << enter any nice name you want your recipient to see when they receive your email
Please enter your From: email address << enter the email address you want your recipient to see when they receive your email
Please enter your Reply-to: email address << enter the real email address you want your recipient's reply to be delivered to
Enter 1 to use sendmail or 2 to use a SMTP server << enter 2
Please enter the address of your SMTP server << you can get this info from your email provider. I personally use gmail so it is : smtp.gmail.com
Please enter the SMTP port number << you can get this info from your email provider. If not sure, leave the default value (25) by just entering without keying in anything
Please select SMTP authentication << enter 2
Please enter your SMTP username << you can get this info from your email provider. If you use gmail, then enter your gmail username here.
Please enter your SMTP password << you can get this info from your email provider. If you use gmail, then enter your gmail password here. Be careful though, your password will be in PLAIN TEXT .
Use TLS << enter "true"

Once you key in all these details . You are done and ready to use "email" .

Sidenote : all your configurations are stored in /etc/email/email.conf in PLAIN TEXT, including your user name and password. So just a note of caution that anyone having access to this file can see your credentials.
What works for me personally is that I created a seperate dummy gmail account, and then during the step up, at step “Please enter your Reply-to: email address”, I enter my actual business email address that I want all correspondences to reach.

7 thoughts on “How to configure and send email from cygwin

  1. Hi,

     

    I followed all above steps for sending the email from my cygwin. But while sending the email I am getting the following error.

     

    email: FATAL: Could not connect to server: smtp.gmail.com on port: 25: Operation not permitted

     

    Can you help me in this.

     

    Appreciate the way  u had given the step by step info. Its really helpful

    • Hi, can you do the followings :
      1. check whether the credentials you enter are accurate . Go to /etc/email/email.conf to verify.
      2. check whether the id running “email” has sufficient privilege

      You can send me a screenshot of your setup (hide away your username, password; I don’t want to see those) and the email text you’re sending. Can’t figure out much from your error message.

  2. Wonderfully explained, it works well, thanks! BTW, I like your top image (San Francisco?), where did you get it ?

  3. I’m trying to stand up an Ajaxplorer site and one issue I’m having is getting emails to work.

    I’m using a WAMP server that runs Apache and PHP (obviously) and I’ve already followed your instructions to install and configure “email”.

    However, I’m not sure how to get it working properly with Ajaxplorer. What entries do you have in your php.ini file that relate to sendmail and/or email in general?

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">