|
@@ -267,28 +267,50 @@ class MailHelper
|
|
|
$port = '465';
|
|
$port = '465';
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
- $smtp_username = "admin@helongfx.com";
|
|
|
|
|
- $host = 'hwsmtp.exmail.qq.com';
|
|
|
|
|
- $password="Helonk99";
|
|
|
|
|
|
|
+ $pay_mail = "admin@vegardmkt.com";
|
|
|
|
|
+ $smtp_username = "apikey";
|
|
|
|
|
+ $host = 'smtp.sendgrid.net';
|
|
|
|
|
+ $password="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";
|
|
|
$port = '465';
|
|
$port = '465';
|
|
|
}
|
|
}
|
|
|
- // 设置新的邮箱地址发送
|
|
|
|
|
- Yii::$app->set('mailer', [
|
|
|
|
|
- 'class' => 'yii\swiftmailer\Mailer',
|
|
|
|
|
- 'useFileTransport' => false,
|
|
|
|
|
- 'transport' => [
|
|
|
|
|
- 'class' => 'Swift_SmtpTransport',
|
|
|
|
|
- 'host' => $host,
|
|
|
|
|
- 'username' => $smtp_username,
|
|
|
|
|
- 'password' => $password,
|
|
|
|
|
- 'port' => $port,
|
|
|
|
|
- 'encryption' => 'ssl',
|
|
|
|
|
- ],
|
|
|
|
|
- 'messageConfig' => [
|
|
|
|
|
- 'charset' => 'UTF-8',
|
|
|
|
|
- 'from' => [$smtp_username => '和隆']
|
|
|
|
|
- ],
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+ if($number==0){
|
|
|
|
|
+ // 设置新的邮箱地址发送
|
|
|
|
|
+ Yii::$app->set('mailer', [
|
|
|
|
|
+ 'class' => 'yii\swiftmailer\Mailer',
|
|
|
|
|
+ 'useFileTransport' => false,
|
|
|
|
|
+ 'transport' => [
|
|
|
|
|
+ 'class' => 'Swift_SmtpTransport',
|
|
|
|
|
+ 'host' => $host,
|
|
|
|
|
+ 'username' => $smtp_username,
|
|
|
|
|
+ 'password' => $password,
|
|
|
|
|
+ 'port' => $port,
|
|
|
|
|
+ 'encryption' => 'ssl',
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'messageConfig' => [
|
|
|
|
|
+ 'charset' => 'UTF-8',
|
|
|
|
|
+ 'from' => [$pay_mail => 'Vegard']
|
|
|
|
|
+ ],
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // 设置新的邮箱地址发送
|
|
|
|
|
+ Yii::$app->set('mailer', [
|
|
|
|
|
+ 'class' => 'yii\swiftmailer\Mailer',
|
|
|
|
|
+ 'useFileTransport' => false,
|
|
|
|
|
+ 'transport' => [
|
|
|
|
|
+ 'class' => 'Swift_SmtpTransport',
|
|
|
|
|
+ 'host' => $host,
|
|
|
|
|
+ 'username' => $smtp_username,
|
|
|
|
|
+ 'password' => $password,
|
|
|
|
|
+ 'port' => $port,
|
|
|
|
|
+ 'encryption' => 'ssl',
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'messageConfig' => [
|
|
|
|
|
+ 'charset' => 'UTF-8',
|
|
|
|
|
+ 'from' => [$smtp_username => 'Vegard']
|
|
|
|
|
+ ],
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$mailid = self::saveRecord($isSuccess, $to, $subject, $replace_content);
|
|
$mailid = self::saveRecord($isSuccess, $to, $subject, $replace_content);
|