通过send-mailmessage发送由get-content命令读取txt文件的内容时,文本文件中的中文字符不能被正确识别,显示为?号,难道要用英文版的powershell才能正常??
不好意思,又来麻烦大家了……。!先谢过……。
powershell 命令
$b =Get-Content D:\t.txt Send-MailMessage -to aaa@aaa.com -from aaa@aaa.com -Subject tewst -Body "$b" -SmtpServer email.xmc.wh
通过send-mailmessage发送出来后就变成下面这样的了,中文件全变成了?号,版面也被完全打乱了。
Remove-Item : Access to the path 'D:\windows\Exchange - ??' is denied. ???? ?:2 ??: 6 + $t | Remove-Item -Recurse -ErrorAction: Continue 2> d:\t.txt + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (D:\windows\Exchange - ??:String) [Remove-Item], UnauthorizedAccessException + FullyQualifiedErrorId : RemoveItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.RemoveItemCommand