Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi ! everyone ;

I have the question =
C#
using (MailMessage mm = new MailMessage(txtEmail.Text, txtTo.Text))
            {
                mm.Subject = txtSubject.Text;
                mm.Body = txtBody.Text;
                if (fuAttachment.HasFile)
                {
                    string FileName = System.IO.Path.GetFileName(fuAttachment.PostedFile.FileName);
                    mm.Attachments.Add(new Attachment(fuAttachment.PostedFile.InputStream, FileName));
                }
                mm.IsBodyHtml = false;
                SmtpClient smtp = new SmtpClient();
                smtp.Host = "smtp.gmail.com";
                smtp.EnableSsl = true;
                NetworkCredential NetworkCred = new NetworkCredential(txtEmail.Text, txtPassword.Text);
                smtp.UseDefaultCredentials = true;
                smtp.Credentials = NetworkCred;
                smtp.Port = 587;
                smtp.Send(mm);
                ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Email sent.');", true);
            }

its my codes.
but ı want to a project like google g-mail ı have a login.aspx and ı associate the Send.aspx

Users login.aspx and if ıd and passaword corret go the Send.aspx

and ı' dont Send.aspx login table ı wanna login.aspx
Posted
Updated 12-Apr-14 3:16am
v2

1 solution

you can do it in two ways..

1) Check for username and password in your own database where it is already inserted of gmail account

do it in this way...

Simple login form example in asp.net Check Username and Password availability in database[^]

Simple User Login in ASP.NET using C#[^]

Simple User Login Form example in ASP.Net[^]


2) You can login into your website using gmail credential using google API


Login with google using Asp.NET[^]

ASP.NET - Signin with Google plus using Google Plus API - Part 1[^]

How to Integrate Google Authentication in Asp.Net Application[^]

After successful login redirect to send.aspx.. :)
 
Share this answer
 
v3

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