How to send testmail for sendmail in UBUNTU

you can test if sendmail is configured correctly by sending an email. Follow these steps to send an email using sendmail −

  • Open a terminal window on your Ubuntu server.
  • Type following command to create a new email −
echo "Subject: Test email" | sendmail -v recipient@email.com

Replace “adityaypi@yahoo.com” with the email address that you want to send the email to.

  • Press Enter and then type in the body of the email.
  • Press Ctrl+D to send the email.
  • Check the email address that you sent email to and verify that you have received email.

If you receive the email, then sendmail is working correctly and configured to send emails using your Gmail account.

Advantages of Configuring Sendmail with Gmail

There are several advantages to configuring sendmail with Gmail on Ubuntu. Some of these include −

  • Reliable Delivery − When you configure sendmail with Gmail, you can rely on the stability and reliability of Gmail server to ensure that your emails are delivered successfully.
  • Improved Security − By using an app password instead of your regular Gmail password, you can improve security of your Gmail account and prevent unauthorized access.
  • Convenience − Configuring sendmail with Gmail is a convenient way to send emails from your Ubuntu server. You can send emails from command line or automate email tasks using scripts.
  • Low Cost − Using sendmail with Gmail is a low-cost solution for sending emails from your Ubuntu server. You don’t need to set up your own mail server or pay for an external email service.


Leave a Reply