if ($nooatt > 0){ $sender->OpenMultipart({ smtp =>"$smtp", to =>"$callemail", from =>"$ticketad", fake_from =>"$ticketad", subject =>"Reply from Me: $callid", headers => "Errors-To: postmaster\@mydomain.com"}); die "Error: $Mail::Sender::Error\n" unless ref $sender; $sender->Body; $sender->SendLineEnc(<<"*END*"); $body *END* #build attachments for ($x=0; $x < $nooatt; $x++){ $sender->Attach({ description => "attachment$x", ctype => "$atttype[$x]", encoding => "Base64", disposition => "attachment; filename=\"$attname[$x]\"; type=\"$atttype[$x]\"", file => "$attachment[$x]"}); die "Error: $Mail::Sender::Error\n" unless ref $sender; }