我已经在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) 找到解决方案 花了一段时间,安装了所有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
我需要一种在预先存在的行之间插入新单元格和/或行而不删除任何行的方法。
我尝试使用:
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)
但不幸的是,它删除了行中的一些行以适应这种转变。删除的行似乎是随机的,它们实际上并不直接位于移位行的下方或上方。如果我移动不止一行,它们似乎发生在移动的行之间。
预先感谢您的帮助。
.net-core ×1
apache ×1
apache-poi ×1
asp.net-core ×1
c# ×1
excel ×1
java ×1
php ×1
phpmailer ×1