/ Published in: Bash

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/bin/bash ## vim:ts=4:sw=4:tw=100:ai:nowrap:formatoptions=croqln: file=${1} echo -n "Enter body:" read body echo -n "Enter Subject: " read subject [[ -z "$body" ]] && { body="Sending attachment using mail"; } [[ -z "$subject" ]] && { subject="backup: $file "; } [[ -z "$file" ]] && { echo "Error: file blank." 1>&2; exit 1; } { echo -e "$body"; uuencode "$file" "$file"; } | mail -s "$subject" ${GMAIL_USER}@gmail.com ;
Comments
