Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Blat:
blat -to [email protected] -server smtp.example.com -f [email protected] -subject "subject" -body "body"
Blat:
您还可以使用 Power Shell 脚本:
$smtp = new-object Net.Mail.SmtpClient("mail.example.com") if( $Env:SmtpUseCredentials -eq "true" ) { $credentials = new-object Net.NetworkCredential("username","password") $smtp.Credentials = $credentials } $objMailMessage = New-Object System.Net.Mail.MailMessage $objMailMessage.From = "[email protected]" $objMailMessage.To.Add("[email protected]") $objMailMessage.Subject = "eMail subject Notification" $objMailMessage.Body = "Hello world!" $smtp.send($objMailMessage)
You can also use a Power Shell script:
PowerShell 附带了一个内置命令。 因此,直接从 .bat 文件运行:
.bat
powershell -ExecutionPolicy ByPass -Command Send-MailMessage ^ -SmtpServer server.address.name ^ -To [email protected] ^ -From [email protected] ^ -Subject Testing ^ -Body 123
NB -ExecutionPolicy ByPass 仅当您尚未设置运行权限时才需要PS from CMD
-ExecutionPolicy ByPass
对于那些希望从 powershell 中调用它的人来说,请删除 -Command [inclusive] 之前的所有内容,` 将是您的转义符字符(不是 ^)
-Command
`
^
PowerShell comes with a built in command for it. So running directly from a .bat file:
NB -ExecutionPolicy ByPass is only needed if you haven't set up permissions for running PS from CMD
Also for those looking to call it from within powershell, drop everything before -Command [inclusive], and ` will be your escape character (not ^)
bmail。 只需安装 EXE 并运行如下行:
bmail -s myMailServer -f [email protected] -t [email protected] -a "Production Release Performed"
bmail. Just install the EXE and run a line like this:
我们在我们的环境中一直使用 bla 来执行此操作。 我还使用它通过 Stunnel 连接到 Gmail。 这是发送文件的参数
blat -to [email protected] -server smtp.example.com -f [email protected] -subject "subject" -body "body" -attach c:\temp\file.txt
或者您可以将该文件作为正文放入
blat c:\temp\file.txt -to [email protected] -server smtp.example.com -f [email protected] -subject "subject"
We use blat to do this all the time in our environment. I use it as well to connect to Gmail with Stunnel. Here's the params to send a file
Or you can put that file in as the body
有多种方法可以处理这个问题。
我的建议是使用功能强大的 Windows 免费软件控制台应用程序 SendEmail。
sendEmail.exe -f [email protected] -o message-file=body.txt -u subject message -t [email protected] -a attachment.zip -s smtp.gmail.com:446 -xu gmail.login -xp gmail.password
There are multiple methods for handling this problem.
My advice is to use the powerful Windows freeware console application SendEmail.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(6)
Blat:
Blat:
您还可以使用 Power Shell 脚本:
You can also use a Power Shell script:
PowerShell 附带了一个内置命令。 因此,直接从
.bat
文件运行:NB
-ExecutionPolicy ByPass
仅当您尚未设置运行权限时才需要PS from CMD对于那些希望从 powershell 中调用它的人来说,请删除
-Command
[inclusive] 之前的所有内容,`
将是您的转义符字符(不是^
)PowerShell comes with a built in command for it. So running directly from a
.bat
file:NB
-ExecutionPolicy ByPass
is only needed if you haven't set up permissions for running PS from CMDAlso for those looking to call it from within powershell, drop everything before
-Command
[inclusive], and`
will be your escape character (not^
)bmail。 只需安装 EXE 并运行如下行:
bmail. Just install the EXE and run a line like this:
我们在我们的环境中一直使用 bla 来执行此操作。 我还使用它通过 Stunnel 连接到 Gmail。 这是发送文件的参数
或者您可以将该文件作为正文放入
We use blat to do this all the time in our environment. I use it as well to connect to Gmail with Stunnel. Here's the params to send a file
Or you can put that file in as the body
有多种方法可以处理这个问题。
我的建议是使用功能强大的 Windows 免费软件控制台应用程序 SendEmail。
There are multiple methods for handling this problem.
My advice is to use the powerful Windows freeware console application SendEmail.