小编Man*_*sha的帖子

如何在 asp.net C# 中使用启用两因素身份验证的 office365 电子邮件帐户发送电子邮件?

我正在尝试使用启用了双因素身份验证的office365电子邮件帐户发送电子邮件。它给出了身份验证失败的错误。对于尚未启用双因素身份验证的电子邮件帐户,工作正常。如何解决这个问题?

using (SmtpClient client = new SmtpClient())
{
   client.Port = Convert.ToInt32(appSettings["Port"]);
   client.DeliveryMethod = SmtpDeliveryMethod.Network;
   client.Host = "smtp.office365.com"; 
   client.EnableSsl = true;
   client.UseDefaultCredentials = false;
   client.Credentials = new System.Net.NetworkCredential(SenderMailAddress, SenderMailPassword); 
   email.Subject = String.Format("{0}", txtMailSubject.Text);
   //                   
   email.Body = String.Format("{0}", text);

   email.IsBodyHtml = true;                  

   client.Send(email);
}
Run Code Online (Sandbox Code Playgroud)

错误信息是

System.Net.Mail.SmtpException: SMTP 服务器需要安全连接或客户端未通过身份验证。服务器响应为:5.7.1 客户端未在 System.Net.Mail.MailCommand.CheckResponse 处进行身份验证

c# asp.net email office365 two-factor-authentication

6
推荐指数
1
解决办法
5125
查看次数

使用php中的按钮单击动态向表中添加新行

我已经使用 php 创建了一个动态表。现在我想添加这个功能。在此处输入图片说明

当我们点击提交按钮时,它应该自动向数据库添加数据并创建新行,并且前一行应该被禁用,无法编辑。如何做到这一点?

<?php 
session_start();
require_once "header.php";
?>
<body>
<div class="text-center">
<h1>PAYMENT PAGE</h1>
</div>
<hr>

  <div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-bordered table-hover" id="tab_logic">
                <thead>
                    <tr >
                        <th class="text-center">
                            #
                        </th>
                        <th class="text-center">
                            User ID
                        </th>
                        <th class="text-center">
                            Name
                        </th>
                        <th class="text-center">
                            NIC
                        </th>
                        <th class="text-center">
                            Amount
                        </th>
                        <th class="text-center">
                            Date
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr id='addr0'>
                        <td>
                        1
                        </td>
                        <td>
                        <input type="text" name='uid'  placeholder='User ID' class="form-control"/>
                        </td>
                        <td>
                        <input type="text" name='uname' placeholder='Name' class="form-control"/>
                        </td> …
Run Code Online (Sandbox Code Playgroud)

html javascript php

5
推荐指数
1
解决办法
1万
查看次数