小编Ya *_*ang的帖子

PHPMailer - 无法进行身份验证

我已经在PHP服务器上运行PHPMailer一年了.一切都很好,直到3天前我开始收到以下错误:

SMTP错误:无法进行身份验证.

允许不太安全的应用程序打开

这是代码:

function SendEmail($to,$cc,$bcc,$subject,$body) {
require 'PHPMailerAutoload.php';

$mail = new PHPMailer(true);
$mail->SMTPDebug  = 1;
try {
$addresses = explode(',', $to);
foreach ($addresses as $address) {
    $mail->AddAddress($address);
}
if($cc!=''){
   $mail->addCustomHeader("CC: " . $cc);
}
if($bcc!=''){
   $mail->addCustomHeader("BCC: " . $bcc);
}
$mail->IsSMTP();
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->SMTPSecure = "tls";                 // sets the prefix to the servier
$mail->Host = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port = 587;   
$mail->Username = "myemail@gmail.com"; // SMTP username
$mail->Password …
Run Code Online (Sandbox Code Playgroud)

php phpmailer

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

VS2017 - 缺少.net核心> 2.1作为目标框架

找到解决方案 花了一段时间,安装了所有sdks,然后运行所有运行时重新安装了我想要的最新版本!

目标,在Visual Studio中将netcore 2.1或更高版本作为下拉选项.我已经看过可能重复的问题!

细节

在Visual Studio 15.7到15.8.4 .net核心2.1或更高版本的最后一次更新后,从目标框架列表中消失了.

我看了下面的其他解决方案.因为我在阳光下安装了每个版本,所以没用.见下面的屏幕.

检查下面的解决方案(我已在这里寻找解决方案!): VS2017:目标框架下拉列表未显示.NET Core 2.1选项

当前的.NET SDK不支持以.NET Core 2.1为目标.目标.NET Core 2.0或更低版本,或使用支持.NET Core 2.1的.NET SDK

参考屏幕: 在此输入图像描述 在此输入图像描述 在此输入图像描述 在此输入图像描述

UPDATE1:已删除2.2预览(未解决,仍然缺少2.1) 在此输入图像描述

c# visual-studio .net-core asp.net-core

3
推荐指数
2
解决办法
9901
查看次数

Apache POI 换行

我需要一种在预先存在的行之间插入新单元格和/或行而不删除任何行的方法。

我尝试使用:

public static void addRow(File f, int amount, int currentRow)
        throws Exception {
    FileInputStream file = new FileInputStream(f);
    XSSFWorkbook workbook = new XSSFWorkbook(file);
    XSSFSheet sheet = workbook.getSheetAt(0);
    sheet.shiftRows(currentRow, currentRow + amount, amount, true, true);
    file.close();
    FileOutputStream out = new FileOutputStream(f);
    workbook.write(out);
    out.close();
}
Run Code Online (Sandbox Code Playgroud)

但不幸的是,它删除了行中的一些行以适应这种转变。删除的行似乎是随机的,它们实际上并不直接位于移位行的下方或上方。如果我移动不止一行,它们似乎发生在移动的行之间。

预先感谢您的帮助。

java apache excel apache-poi

0
推荐指数
1
解决办法
8352
查看次数