我正在编写自己的SMTP
客户端c#
(用于紧凑型框架)。尝试使用smtp.gmail.com
服务器
如果客户端发送空`,则在成功STARTTLS
命令后。smtp
EHLO Command response from server is
message = "EHLO 10.192.4.223\r\n";
Write(message);
response = Response();
if (response.Substring(0, 3) != "250")
{
throw new SmtpException(response);
}
message = "STARTTLS\r\n";
Write(message);
response = Response();
if (response.Substring(0, 3) != "220")
{
throw new SmtpException(response);
}
message = "EHLO 10.192.4.223\r\n";
Write(message);
response = Response();
if (response.Substring(0, 3) != "250") //empty response
{
throw new SmtpException(response);
}