Click here to Skip to main content
15,912,504 members
Please Sign up or sign in to vote.
3.25/5 (4 votes)
See more:
C# .net: How to create a application that logins into an email ID with password displays inbox and can compose mail through the application
Posted
Comments
[no name] 9-Sep-12 21:15pm    
You create a project and write a bunch of code that does what you want.
[no name] 10-Sep-12 1:03am    
Have you tried gmail or yahoo! mail? They do exactly what you wanted and more! :)

Here is an example for Gmail to send a mail:
C#
using System.Net.Mail;
using System.Net;

            var fromAddress = new MailAddress("from@gmail.com", "From Name");
            var toAddress = new MailAddress("to@yahoo.com", "To Name");
            const string fromPassword = "password";
            const string subject = "test";
            const string body = "Hey now!!";

            var smtp = new SmtpClient
            {
                Host = "smtp.gmail.com",
                Port = 587,
                EnableSsl = true,
                DeliveryMethod = SmtpDeliveryMethod.Network,
                Credentials = new NetworkCredential(fromAddress.Address, fromPassword),
                Timeout = 20000
            };
            using (var message = new MailMessage(fromAddress, toAddress)
            {
                Subject = subject,
                Body = body
            })
            {
                smtp.Send(message);
            }

There is also an API that you may want to use:
https://developers.google.com/google-apps/gmail/[^]

Sending the mail should be identical for most email providers. Displaying the inbox may be different for each, so you may want to search for an API depending on which provider you use.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900