$destination = 'jenkinsr.hotmail.com'; $from = 'environment_variable'; #I need the variable here. open (MAIL,"|$sendmail") || die "Can't open sendmail pipe: $!\n"; print MAIL <<"EOF"; To: $destination From: $from Subject: Certify Report $information EOF