c# - 发送电子邮件时也在我的收件箱中收到电子邮件
问题描述
为什么从 Gmail API 发送电子邮件时,会向提供的电子邮件地址发送一封电子邮件,但我的收件箱中也收到了电子邮件?
public ActionResult NewEmail(String from, String text, string To, string sub)
{
GmailService service = GmailServSendMail();
string plainText = "To:" + To + "," + from + "\r\n" + "Subject:" + sub + "\r\n" + "Content-Type: text/html; charset=us-ascii\r\n\r\n" + text;
var newMsg = new Google.Apis.Gmail.v1.Data.Message();
newMsg.Raw = Base64UrlEncode(plainText.ToString());
List<string> labe = new List<string>();
labe.Add("SENT");
newMsg.LabelIds = labe;
service.Users.Messages.Send(newMsg, "me").Execute();
return View("Email");
}
解决方案
推荐阅读
- c# - .Net 通过字符串变量访问实例化的类成员
- import - 尝试运行加密警报“没有名为 urllib3 的模块
- c# - 使用递归函数判断传入的值是否是游戏中可能的分数
- asp.net-mvc - 由于拆分架构导致的 WebAuthn 问题
- visual-studio-2019 - VS 2019 和 SAP HANA 数据源
- javascript - JavaScript/TypeScript 中 async 关键字的用途是什么?
- reactjs - 过滤状态数据然后立即将其取消过滤以进行下一次过滤器调用
- postgresql - TimescaleDB手动解压
- c# - 使图像出现在前面
- python - 如何在 Python 中读取输入直到下一次出现