Reputation: 1
I am getting an error in smtp connection when I send a request to stmp server.
IList<MXServer> list = new List<MXServer>();
foreach (string line in result.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
{
if (line.Contains("MX preference =") && line.Contains("mail exchanger ="))
{
MXServer mxServer = new MXServer();
mxServer.Preference = Int(GetStringBetween(line, "MX preference = ", ","));
mxServer.MailExchanger = GetStringFrom(line, "mail exchanger = ");
list.Add(mxServer);
}
}
Upvotes: 0
Views: 544
Reputation: 2919
By using SMTP, you can ask the server if it has the user. SMTP is a text based protocol. But there are some important points:
PTR
) record.SPF
record.VRFY
command b. RCPT TO
VRFY
because of security reasons.So here is an SMTP session example:
C: MAIL FROM:<[email protected]>
S: 250 OK
C: RCPT TO:<[email protected]>
S: 250 OK
C: RCPT TO:<[email protected]>
S: 250 OK
Basically if you get 250 ...
answer for a RCPT TO
command 90% the email address is ok. Then you can abort the connection.
Upvotes: 1