My sample data File is
$ cat /fullpath/a.csv
a@gmail.com, Amit Singh
k@gmail.com, 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="xxxx@gmail.com(John Smith)" -S smtp-auth-user=xxxx@gmail.com -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?