怎么做一个gmail项目 [英] how do ı make a gmail project

查看:166
本文介绍了怎么做一个gmail项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!每个人;



我有问题=

hi ! everyone ;

I have the question =

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);
            }



我的代码。

但是我希望像google g-mail这样的项目有一个login.aspx和ı关联Send.aspx



用户login.aspx如果ıd和passaword corret go Send.aspx



和ı'不发送.aspx登录表ı想登录.aspx


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

推荐答案

你可以用两种方式做到这一点..



1)检查您自己的数据库中是否已插入gmail帐户的用户名和密码



这样做......



asp.net中的简单登录表单示例检查数据库中的用户名和密码可用性 [ ^ ]



使用C#在ASP.NET中进行简单用户登录 [ ^ ]



简单用户登录表单示例在ASP.Net中 [ ^ ]





2)您可以使用google使用gmail凭证登录您的网站API




使用Asp.NET登录google [ ^ ]



ASP.N ET - 使用Google +使用Google Plus API登录 - 第1部分 [ ^ ]



如何在Asp.Net应用程序中集成G​​oogle身份验证 [ ^ ]



成功登录后重定向到send.aspx .. :))
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.. :)


这篇关于怎么做一个gmail项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆