| 157 | To send an image attachment modify the message.txt |
| 158 | {{{ |
| 159 | From: wilsonwareapps@gmail.com |
| 160 | To: dwilson@cardet.com |
| 161 | Subject: Test email from 825 |
| 162 | MIME-Version: 1.0 |
| 163 | Content-Type: multipart/mixed; boundary="MyBoundaryString" |
| 164 | |
| 165 | |
| 166 | --MyBoundaryString |
| 167 | Content-Type: text/plain |
| 168 | Content-Transfer-Encoding: 7bit |
| 169 | |
| 170 | Test 12345 |
| 171 | ABCD |
| 172 | |
| 173 | --MyBoundaryString |
| 174 | Content-Type: image/jpeg |
| 175 | Content-ID: <image11> |
| 176 | Content-Transfer-Encoding: base64 |
| 177 | |
| 178 | }}} |
| 179 | |
| 180 | Note that there has to be a blank line at the end of the file |
| 181 | |
| 182 | Encode the jpeg image into base64 such as: |
| 183 | {{{ |
| 184 | base64 /usr/share/apache2/default-site/htdocs/images/v000011_1.jpg /tmp/attachment |
| 185 | }}} |
| 186 | |
| 187 | Send the email. |
| 188 | |
| 189 | {{{ |
| 190 | cat message.txt /tmp/attachment | msmtp -t |
| 191 | }}} |
| 192 | |