What are the possible protocols for sending email in C# rather than SMTP?
POP3 and IMAP are for only receiving emails. And how I can using pop3 in c#?
What are the possible protocols for sending email in C# rather than SMTP?
POP3 and IMAP are for only receiving emails. And how I can using pop3 in c#?
SMTP (Simple Mail Transfer Protocol) is a part of the application layer of the TCP/IP protocol. It is an Internet standard for electronic mail (email) transmission.
SMTP provides a set of protocol that simplify the communication of email messages between email servers. Most SMTP server names are written in the form "smtp.domain.com" or "mail.domain.com": for example, a Gmail account will refer to smtp.gmail.com. It is usually used with one of two other protocols, POP3 or IMAP, that let the user save messages in a server mailbox and download them periodically from the server.
This Stackoverflow question/answers will help you.
And you should also check this repo
Pop3 example:
using System;
using Limilabs.Mail;
using Limilabs.Client.POP3;
class Program
{
static void Main(string[] args)
{
using (Pop3 pop3 = new Pop3())
{
pop3.Connect("pop3.example.com"); // or ConnectSSL for SSL
pop3.Login("user", "password");
// Receive all messages and display the subject
MailBuilder builder = new MailBuilder();
foreach (string uid in pop3.GetAll())
{
IMail email = builder.CreateFromEml(
pop3.GetMessageByUID(uid));
Console.WriteLine(email.Subject);
Console.WriteLine(email.Text);
}
pop3.Close();
}
}
}