Hello, I want to create small e-mail program.
I want to know how to create login and password areas.
What commands I need to use to connect to mail server.
Can some1 please show some examples.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 10, 2011, 10:21 PM EDT
download the Source code and check it out..
I'm sure you'll definitely get idea about it....
Janis Peksa145 reputationPosted Jul 10, 2011, 10:43 PM EDT
And I need sample of connection to mail server with login, password.
Priya LingeRank #785 · 2.9K reputationPosted Jul 11, 2011, 3:14 AM EDT
Make one method,suppose
public void SendMail(string emailTo, string emailFrom, string msgSubject, string msgBody)
{
try
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress(emailFrom);
msg.To.Add(new MailAddress(emailTo));
msg.Subject = msgSubject;
msg.Body = "Your Password : \n" + msgBody + ", please keep it safe";
msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; // Replace with your servers IP address
smtp.Port = 587
smtp.EnableSsl = false;
smtp.Send(msg);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
You can call this method on button click ,Say Send Mail Button.
Make some changes in webconfig file ,
<system.net>
<mailSettings>
<smtp from=[email protected]>
<network userName="[email protected]" host="gmail.com" port="567" password="abcd"/ >
mailSettings>
system.net>
Please check below link,
http://csharp.net-informations.com/communications/csharp-smtp-mail.htm
I hope it will help you to understand the mail program .
Thanks.
Janis Peksa145 reputationPosted Jul 11, 2011, 3:29 AM EDT
How can I do that ?
Just press button and it's tells me that login and password is correct or incorrect.
Jiteendra SampathiraoRank #585 · 4.1K reputationPosted Jul 11, 2011, 4:02 AM EDT
Store the user information like username, pwd, contact number etc in database.
At login time retrieve the username and pws details from database and compare the username,pwd details with given details....
If username,pwd matches then show the message "successfull" otherwise 'not correct".
Janis Peksa145 reputationPosted Jul 11, 2011, 4:08 AM EDT
Not my database.
Sam HobbsRank #107 · 20.5K reputationPosted Jul 11, 2011, 4:51 PM EDT