If you mean doing this via shell, then yes this is possible. We may have a different result in mind but the operation is similar to this structure I have written previously to deliver the message via shell.
See: http://www.akamay.net/PUBLIC/massmail.tar
The script uses three (3) files.
Credential File - The actual configuration file. Put it in /tmp
HEAD_FROM="BSDUSER" # Mail from:
HEAD_TO="${FIELD1[$a]}" # Rcpt to:
HEAD_REPLY-TO="info@my.email.com" # Reply to :)
HEAD_BCC-TO="i@my.email.com" # BCC to
HEAD_SUBJECT="NOTICE - Personalize mass mail for ${FIELD3[$a]}"
HEAD_PRIORITY="High" # Low / Medium / High
HEAD_IMPORTANCE="3" # Importance
HEAD_MIME-VERSION="1.1" # MIME Version
HEAD_CONTENT-TYPE="text/plain" # Plain or HTML
TEAM_CONTACT="info@my.email.com" # Signature @ EOF
INTERVAL="2" # Sleep sec. per send
Owner File - The file containing your FIELD'ed values separated by a ":".
john:Tuesday:john:john@my.email.com
sally:Wednesday:sally:sally@my.email.com
lisa:Friday:lisa:lisa@my.email.com
The actual massmail script. The script is simple. What it does is to parse the configuration file using a for loop with the value of the given fields: field1,2,3 etc. What I did is to substitute this values from the CSV file, store it in an executable text with the correct format and pipe everything to sendmail.
F1=`cat $2 | cut -d: -f1 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
F2=`cat $2 | cut -d: -f2 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
F3=`cat $2 | cut -d: -f3 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
F4=`cat $2 | cut -d: -f4 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
F5=`cat $2 | cut -d: -f5 | perl -ne 'chomp;print" $_"' | sed 's/^[ \t]*//;s/[ \t]*$//'`
echo -e "#!/bin/bash" > $TMP/notify_exec
echo -e "FIELD1=($F1)\nFIELD2=($F2)\nFIELD3=($F3)\nFIELD4=($F4)\nFIELD5=($F5)\n" >> $TMP/notify_exec
echo -e "for ((a=0;a<\${#FIELD1[*]};a++))\ndo" >> $TMP/notify_exec
echo -e "echo \"From:$C_F" >> $TMP/notify_exec
echo -e "To:$C_T\nReply-to:$C_RT\nBcc-to:$C_BT\nSubject:$C_S\nPriority:$C_P" >> $TMP/notify_exec
echo -e "X-Mail-Priority:$C_I\nMime-Version:$C_M\nContent-Type:$C_C\n$C_MSG\n\n\n" >> $TMP/notify_exec
echo -e "Generated using: $0 - Got questions? E-Mail us at: $C_TM" >> $TMP/notify_exec
echo -e "\" | /bin/sendmail -t -oi" >> $TMP/notify_exec
echo -e "sleep $C_SL" >> $TMP/notify_exec
echo -e "done\nexit 0" >> $TMP/notify_exec
chmod +x $TMP/notify_exec
I ran into some issues with using mailx regarding the custom reply so I switched with sendmail to deliver the message and it works fine.