in reply to Sendmail Help!

It would be better if you showed us a complete, but simple, test so we could help you better.
Are you sure that $name is getting set properly to something?
Perhaps a debug line like

print "name var is set to $name\n";
might be useful.
Are you doing "use strict", "use warnings", "use diagnostics"?

non-Perl: Andy Ford