有没有一个例子可以向我解释如何从我的本地主机服务器发送电子邮件? 我写了这个例子,但它不起作用,错误是"发送邮件失败"。
SmtpClient smtpClient = new SmtpClient();
smtpClient.Host = "localhost";
smtpClient.Port = 25;
smtpClient.EnableSsl = false;
smtpClient.Credentials = new NetworkCredential("mostang1970@yahoo.com", "secret");
smtpClient.Send("mostang1970@yahoo.com", "hadinematipartow@yahoo.com", "Let’s eat lunch!", "Lunch at the Steak House?");//here is the error
那我在 web.config 中应该做什么呢?