确定将Gmail用作默认Windows 10电子邮件协议

时间:2018-11-02 18:29:00

标签: windows powershell gmail protocols email-attachments

我很固执。设置Outlook,Thunderbird等会容易得多。请提供有关我建议使用gmail的解决方案的反馈。

我使用名为“ Greenshot”的屏幕截图程序。我想使用上下文菜单功能“通过电子邮件发送”(用于最近捕获的屏幕截图)。但是,当我这样做时,我无法在Windows 10中设置基于Web的电子邮件客户端(例如gmail)。

是否可以在Powershell中创建一个简短的脚本,例如: https://www.pdq.com/blog/powershell-send-mailmessage-gmail/

除此之外,还可以自定义“收件人:”,“正文”和其他字段。

基本上,我正在寻找一种与gmail交互的最小方法,而不是使用其他独立客户端。

谢谢

1 个答案:

答案 0 :(得分:0)

我丢失了什么吗?或者您提供的链接 是否已经包含一个脚本,可用于修改正文,To:等。?

通过您粘贴的链接,专门用于gmail:

##############################################################################
$From = "YourEmail@gmail.com"
$To = "AnotherEmail@YourDomain.com"
$Cc = "YourBoss@YourDomain.com"
$Attachment = "C:\temp\Some random file.txt"
$Subject = "Email Subject"
$Body = "Insert body text here"
$SMTPServer = "smtp.gmail.com"
$SMTPPort = "587"
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject `
-Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl `
-Credential (Get-Credential) -Attachments $Attachment
##############################################################################