Script not entering VRFY after nc command

I am making a bash script right now and am running into an issue. As I am new to scripting, I do not know exactly what to do to get what I'm looking for in my script.

Essentially, my script will automatically input VRFY common names after nc [ip] [port]

Example:

nc 192.168.248.133 25

VRFY Allison
VRFY Adam
VRFY Bob

When I put that into a script, how would I make the command VRFY Allison be entered in directly after the command nc 192.168.248.133 25 ?

Thanks in advanced

To feed the strings starting with VRFY to the process reading from port 25 on the server at IP address 192.168.248.133, try:

nc 192.168.248.133 25<<-EOF
VRFY Allison
VRFY Adam
VRFY Bob
EOF
1 Like

Thank you Don Cragun,

It works perfectly now.

Cheers,
ksrhayward