protected void btnSubmit_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress(txtlogfrom.Text);
msg.To.Add(txtTo.Text);
msg.Subject = txtSubject.Text;
msg.Body = txtBody.Text;
using (SmtpClient client = new SmtpClient())
{
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential(txtlogfrom.Text, password);
client.Host = "smtp.gmail.com";
client.Port = 587;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(msg);
}
}
当我们提供用户名和密码时,上述代码正在运行
但我需要向发件人发送自动回复邮件,当他向我发送邮件时。
帮我找到解决方案
先谢谢
答案 0 :(得分:-1)
如果您要监控的邮箱完全由您控制。即你有凭据,那么你有几个选择。