Reputation: 100
I need a mail client library (IMAP and SMTP) for Windows Phone 8 or another alternative (like TcpClient, SslClient in Windows 8, but I don't get in Windows Phone 8). I google a lot. Please let me know any library or Article/Tutorial to implement IMAP and SMTP mail client on Windows Phone 8.
Thanks in Advance.
Upvotes: 2
Views: 1550
Reputation: 9652
I found this link very useful for Windows phone 8.1
Make a class like MailManager in data model folder and add this line of code at the top of your class using Limilabs.Mail;
also add this Mail.dll
library to your project. Read more
StorageFile imageFile = ...;
StorageFile attachmentFile = ...;
MailBuilder builder = new MailBuilder();
builder.Html = @"Html with an image: <img src="" cid:lena@@example.com""="">";
MimeData image = await builder.AddVisual(imageFile);
image.ContentId = "[email protected]";
await builder.AddAttachment(attachmentFile);
builder.To.Add(new MailBox("[email protected]"));
builder.From.Add(new MailBox("[email protected]"));
builder.Subject = "Subject";
IMail email = builder.Create();
using(Smtp smtp = new Smtp())
{
await smtp.Connect("smtp.server.com"); // or ConnectSSL for SSL
await smtp.UseBestLoginAsync("user", "password");
await smtp.SendMessageAsync(email);
await smtp.CloseAsync();
}
Upvotes: 0
Reputation: 29421
You can work with sockets in Windows Phone 8. Apparently there is a new Windows.Networking.Sockets API you can try using, but the classic one based on System.Net.Sockets
should still work - here's an example.
You'd still have to implement IMAP and SMTP yourself though, unless some functionality already exists that we haven't spotted yet.
Upvotes: 3