首页 > 解决方案 > 发送电子邮件时使用代理。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(); }

标签: c#emailproxy

解决方案


你看错了一面。Gmail 已经剥离了客户端的 IP 地址。如果您拥有电子邮件服务器,也可以对其进行配置。


推荐阅读