My sample data File is
$ cat /fullpath/a.csv
[email protected], Amit Singh
[email protected], Km Singh
I am using script.sh
#!/bin/bash
while IFS= read -r line
do
email=$(echo $line | awk -F, '{print $1 }')
name=$(echo $line | awk -F, '{print $2 }')
echo | mailx -v -s "Helo $name" -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp=smtp://smtp.gmail.com:587 -S from="[email protected](John Smith)" -S [email protected] -S smtp-auth-password=xxxxpassword## -S ssl-verify=ignore -S nss-config-dir=~/.certs "$name<$email>"
done < /fullpath/a.csv
When I send an email, it goes well. but won't pick receiver name in "$name<$email>"
how is the correct syntax of receiver name there?