Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
2.25/5 (4 votes)
See more:
MailMessage msg = new MailMessage();
            msg.From = new MailAddress(txtFrom.Text);
            msg.To.Add(txtTo.Text);
            msg.To.Add(txtTo.Text);
            msg.Subject = txtSubject.Text;
            msg.Body = txtBody.Text;
            msg.IsBodyHtml = true;
            msg.Priority = MailPriority.High;
           
            SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
            client.EnableSsl = true;
           
            NetworkCredential credentials = new NetworkCredential(""+txtFrom.Text+"", ""+txtSMTPServer.Text+"");
           
            client.Credentials = credentials;
          
               
                client.Send(msg);



This was the code for sending email.I want to Know how to receive email in my application's inbox .How email is sending from other mail id's(hotmail,yahoo etc)
Posted
Updated 1-Aug-11 0:08am
v2
Comments
Code Master38 1-May-12 12:11pm    
Reason for my vote of 1
nice job copying the tutorial from thecodeproject.

This link will help you
Read E Mails from ASP.NET[^]
 
Share this answer
 
 
Share this answer
 
v2
For sending mail...
Send Mail / Contact Form using ASP.NET and C#[^]
thank u.
 
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