You can connect to Yahoo! IMAP, POP3 and SMTP servers without SSL enabled. The following table shows the available settings to establish connections to Yahoo! Mail servers:
Protocol | Port | Security Mode | Server |
---|---|---|---|
IMAP | 143 993 143 |
Unsecure Implicit Explicit |
imap.mail.yahoo.com |
POP3 | 110 995 110 |
Unsecure Implicit Explicit |
imap.mail.yahoo.com |
SMTP | 587 465 |
Unsecure Implicit |
smtp.mail.yahoo.com |
You can also use the Ultimate Mail to connect to Outlook 365, Outlook.com and Live.com.
The following code snippets show to connect to the Yahoo! Mail Servers using the Imap
, Pop3
, and Smtp
classes:
// Create a new instance of the Imap class and download a message.
using (Imap client = new Imap())
{
// Connect to the server.
client.Connect("imap.mail.yahoo.com", 993, SecurityMode.Implicit);
// Login to the server.
client.Authenticate("mytest@yahoo.com", "password");
// Download a message to an instance of the MailMessage class.
MailMessage msg = client.DownloadMailMessage(imapMessageUniqueId);
}
// Create a new instance of the Pop3 class and download a message.
using (Pop3 client = new Pop3())
{
// Connect to the server.
client.Connect("pop.mail.yahoo.com", 995, SecurityMode.Implicit);
// Login to the server.
client.Authenticate("mytest@yahoo.com", "password");
// Download the message to an instance of the MailMessage class.
MailMessage msg = client.DownloadMailMessage(pop3MessageSequenceNumber);
}
// Create a new instance of the Smtp class and send an email.
using (Smtp client = new Smtp())
{
// Connect to the server.
client.Connect("smtp.mail.yahoo.com", 587);
// Login to the server.
client.Authenticate("mytest@yahoo.com", "password");
// Create a new mail message.
MailMessage msg = new MailMessage();
msg.Subject = "Test Subject";
msg.BodyText = "Content";
msg.From = "from@mydomain.com";
msg.To = "to@somedomain.com";
// And send it.
client.Send(msg);
}
In case you want to connect to the Gmail server, you can now use the OAuth method instead of just using a pair of username and password.