open(MAILPIPE,'|/bin/mailx -s "Happy Birthday" $email') or die "Can't open pipe $!"; Output ====== IST TIMEZONE SET Date and time - Thu Dec 24 14:32:03 2015 BirthdayPerson name is Mallikarjun Gowda Birthdate is 2412 timezone is IST Gender is him Email is email@provider.com Mallikarjun Gowda has birthday today Remember to Wish him a very Happy Birthday You must specify direct recipients with -s, -c, or -b.