c# - 发送电子邮件时使用代理。C#
问题描述
我有一个程序正在向我的客户发送电子邮件。我想做的事情是隐藏发送电子邮件的 ip。如果是的话,这甚至可能吗?这是我的代码:
SmtpClient smtpClient = new SmtpClient("smtp.gmail.com");
MailMessage mail = new MailMessage(email, target, title, msg);
smtpClient.Port = 587;
smtpClient.EnableSsl = true;
smtpClient.Credentials = new System.Net.NetworkCredential(email, password);
try
{
smtpClient.Send(mail);
}
catch (Exception e) { Console.ForegroundColor = ConsoleColor.DarkRed; Console.WriteLine($"Error occured while trying to send email:\n{e.Message}"); Console.ResetColor(); }
解决方案
你看错了一面。Gmail 已经剥离了客户端的 IP 地址。如果您拥有电子邮件服务器,也可以对其进行配置。
推荐阅读
- python - 执行动态数量的 .py 文件
- android - 如何在 RecyclerView.Adapter 中获取 LifecycleOwner 参考?
- c++ - 如何在 OpenSSL 中请求 SSL_accept 出错的原因?
- swift - 快速填充结构的线程和并发性
- python - 炮兵 - script.scenarios.forEach 不是函数
- python-3.x - 从 MixedLM 模型中获取最小均方
- reactjs - 无法从 redux 存储中的 reducer 读取属性
- python - 将 django 模型查询集保存到另一个模型中
- amazon-web-services - 如何在不更改上次修改时间的情况下触发 AWS s3 事件?
- c - 相同的输入数据可以有不同的CRC值吗?