There are several ways to send an email from a Linux system. One common method is to use the sendmail
command-line utility.
Here’s an example of how to send an email using sendmail
:
- Open the terminal and create a new file with a text editor (e.g.
nano
):nano email.txt
In the text file, enter the following information, replacing the placeholder values with your own:
To: [email protected] Subject: Test Email From: [email protected] This is a test email sent from a Linux system.
- Save the file and exit the text editor.
- Use the
sendmail
command to send the email, replacing the recipient email address with the actual email address you want to send the email to:sendmail [email protected] < email.txt
This will send an email to the recipient with the subject “Test Email” and the content “This is a test email sent from a Linux system.”
Note:
sendmail
requires a working mail server to be configured on the system. If you do not have access to a mail server, you can use a third-party email service (such as Gmail or Microsoft Outlook) to send emails.