Created
January 5, 2015 13:59
-
-
Save delputnam/b44118c7974cd0b6643d to your computer and use it in GitHub Desktop.
Send an HTML email from the command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can do this relatively simple from the command line. Save your HTML, but also include the necessary SMTP headers at the top in the source. For this example I'll save the source as example.html in my home directory. | |
~/example.html: | |
From: [email protected] | |
To: [email protected] | |
Subject: Test email | |
Mime-Version: 1.0 | |
Content-Type: text/html | |
<html> | |
<body> | |
<p>Hello world!</p> | |
</body> | |
</html> | |
Now you can send this e-mail from Terminal.app by executing the following command: | |
cat ~/example.html | sendmail -t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment