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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Jul 11, 2011, 8:51 PM
Janis PeksaPosted Jul 11, 2011, 8:08 AM
Not my database.
Jiteendra SampathiraoPosted Jul 11, 2011, 8:02 AM
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 PeksaPosted Jul 11, 2011, 7:29 AM
How can I do that ?
Just press button and it's tells me that login and password is correct or incorrect.
Priya LingePosted Jul 11, 2011, 7:14 AM
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 PeksaPosted Jul 11, 2011, 2:43 AM
And I need sample of connection to mail server with login, password.
Jiteendra SampathiraoPosted Jul 11, 2011, 2:21 AM
download the Source code and check it out..
I'm sure you'll definitely get idea about it....