<?php
require_once 'swiftmailer/swift_required.php';
require_once('dompdf/dompdf_config.inc.php');
spl_autoload_register('DOMPDF_autoload');
date_default_timezone_set('Asia/Manila');
function pdf_create($html,$filename,$stream = TRUE){
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$output = $dompdf->output();
file_put_contents('puja.pdf', $output);
}
$tym = date('g:i s');
$filename = 'print'.$tym;
$dompdf = new DOMPDF();
$html = file_get_contents('vamshi.php');
pdf_create($html,$filename);
?>
<?php
// Create the mail transport configuration
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com',465,'ssl')
->setUsername('[email protected]')
->setPassword('9397343655');
// Create the message
$message = Swift_Message::newInstance()
->setTo(array('[email protected]' =>'vamshi'))
->setSubject("Registration Success !")
->setBody("You have Registered Successfully ! Thank You For Registering With Us.Click link to confirm your account",'text/html')
->setFrom("[email protected]", "Rajesh")
->attach(Swift_Attachment::fromPath('/full/file/path/puja.pdf'));
// Send the email
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
if($mailer){
echo 'eafbaefdbaifhefj';
}
?>
Fatal error: Uncaught exception 'Swift_TransportException' with message 'Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/answer/14257 g74sm5822247pfj.1 - gsmtp "' in C:\xampp\htdocs\PHPLab\new\swiftmailer\classes\Swift\Transport\AbstractSmtpTransport.php:382 Stack trace: #0 C:\xampp\htdocs\PHPLab\new\swiftmailer\classes\Swift\Transport\AbstractSmtpTransport.php(279): Swift_Transport_AbstractSmtpTransport->_assertResponseCode('535-5.7.8 Usern...', Array) #1 C:\xampp\htdocs\PHPLab\new\swiftmailer\classes\Swift\Transport\EsmtpTransport.php(243): Swift_Transport_AbstractSmtpTransport->executeCommand('RSET\r\n', Array, Array) #2 C:\xampp\htdocs\PHPLab\new\swiftmailer\classes\Swift\Transport\Esmtp\Auth\XOAuth2Authenticator.php(54): Swift_Transport_EsmtpTransport->executeCommand('RSET\r\n', Array) #3 C:\xampp\htdocs\PHPLab\new\swiftmailer\classes\Swift\Transport\Esmtp\AuthHandler.php(177): Swift_Transport_Esmtp_A in C:\xampp\htdocs\PHPLab\new\swiftmailer\classes\Swift\Transport\AbstractSmtpTransport.php on line 382получения ошибки -> Фатальная ошибка: Uncaught исключения «Swift_TransportException» с сообщением