#!/bin/gawk -f # This script requires a network-enabled gawk binary. # It will send electonic mail to the address specified in the first field of the # input file. Various generic aspects should be customized. ### <-- You will likely want to change lines preceeded with this type of comment # /inet/protocol/local-port/remote-host/remote-port BEGIN { ### smtp = "/inet/tcp/0/smtp.yourdomain.com/25" ORS = "\r\n" # FS = "," } NF > 0 { print ### print "helo yourhostname.yourdomain.com" |& smtp smtp |& getline response print response ### print "mail from: john.doe@yourdomain.com" |& smtp smtp |& getline response print response print "rcpt to: " $1 |& smtp smtp |& getline response print response print "data" |& smtp smtp |& getline response print response ### print "From: john.doe@yourdomain.com" |& smtp print "To: " $1 |& smtp ### print "Subject: Your Mail Subject Line Here" |& smtp print "" |& smtp ### print "Your message body here. Use additional processing if desired." |& smtp print "." |& smtp smtp |& getline response print response print "quit" |& smtp smtp |& getline response print response close(smtp) }