use Mail::Sender; $To = $ARGV[0]; # Here is passed a valid email-address $From = $ARGV[1]; # Here is passed a valid email-address $Server = $ARGV[2]; # Here is passed a server ip address that doesnt need login authentification $Subject = $ARGV[3]; # Passed a string "subject test" $Body = $ARGV[4]; # Passed a string "body test" $Attach = $ARGV[5]; # Here receive a c:\temp\testatt.txt and this file exists $Cc = ""; $sender = new Mail::Sender { smtp => $Server, from => $From}; $sender->MailFile({ to => $To, subject => $Subject, msg => $Body, file => $Attach}); $sender->Close;