$SomeEntytyREpo->getSimilar($Entity->getId(), $Entity->getOneMoreFieldValue)
composer dumpautoload
composer install
//Include required PHPMailer files
require 'vendor/phpmailer/phpmailer/src/PHPMailer.php';
require 'vendor/phpmailer/phpmailer/src/SMTP.php';
require 'vendor/phpmailer/phpmailer/src/Exception.php';
//Define name spaces
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
//Create instance of PHPMailer
$mail = new PHPMailer();
//Set mailer to use smtp
$mail->isSMTP();
//Define smtp host
$mail->Host = "smtp.gmail.com";
//Enable smtp authentication
$mail->SMTPAuth = true;
//Set smtp encryption type (ssl/tls)
$mail->SMTPSecure = "tls";
//Port to connect smtp
$mail->Port = "587";
//Set gmail username
$mail->Username = "username@GMAIL.COM";
//Set gmail password
$mail->Password = "password";
//Email subject
$mail->Subject = "Test email using PHPMailer";
//Set sender email
$mail->setFrom('username@GMAIL.COM');
//Enable HTML
$mail->isHTML(true);
//Email body
$mail->Body = "<h1>This is HTML h1 Heading</h1></br><p>This is html paragraph</p>";
//Add recipient
$mail->addAddress('recipient@mail.com');
//Finally send email
if ( $mail->send() ) {
echo "Email Sent..!";
}else{
echo "Message could not be sent. Mailer Error:" . $mail->ErrorInfo;
}
//Closing smtp connection
$mail->smtpClose();
import random
import string
length = 16 # кол-во символов в купоне
quantity = 100000 # кол-во купонов
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits # набор символов для купонов
def mask(c, length): # маски для купонов
if length == 16:
c = c[0:4] + '-' + c[4:8] + '-' + c[8:12] + '-' + c[12:16] # маска на 16 символов
elif length == 12:
pass
elif length == 9:
pass
return c
def coupon(length): # ф-я генерации одного купона заданной длинны.
l = []
c = str
for i in range(0, length):
l.append(random.choice(chars))
c = ''.join(l)
c = mask(c, length)
return c
def generator(quantity): # а теперь генерим их сколько надо
a_file = open('data.txt', 'w')
for i in range(0, quantity):
a = coupon(length)
line = (a + '\n')
a_file.write(line)
# print(a)
a_file.close()
generator(quantity)