我正在尝试使用亚马逊的服务发送电子邮件:
String username = "&&&&&&"; // Replace with your SMTP username.
String password = "&&&&&&&"; // Replace with your SMTP password.
String host = "xxxxxxxx";
int port = 25;
String senderAddress = "xxxxxx";
String receiverAddress = inputEmail;
using (var client = new System.Net.Mail.SmtpClient(host, port))
{
client.Credentials = new System.Net.NetworkCredential(username, password);
client.EnableSsl = true;
String message = "Trucking On Demand received a request to reset the password for your account " + inputEmail + ".Your new password is: " + tempPassword;
client.Send
(
senderAddress, // Replace with the sender address.
inputEmail, // Replace with the recipient address.
message,
"This email was delivered through ****."
);
return Ok();
}
}
为什么我的请求超时?我试过搜索互联网,但除了要求我启用TLS之外,aws没有明确的解决方案。我相信client.enablessl可以做到这一点。我是否也需要处理我的客户?即client.dispose();