File: /home/bibuzptr/elearning.bibu-edu.us/current/includes/swiftmailer/email.php
<?php
if(isset($_POST['send'])){
/*require_once('swift_required.php');
emailSlip($data);
function getMailer(){
/* $transport = Swift_SmtpTransport::newInstance('smtp.gmail.com',465, "ssl");
$transport->setUsername("schoolofthenationsdocs");
$transport->setPassword("Trymenot#123");*/
/*
$transport = Swift_SmtpTransport::newInstance('metro.websitewelcome.com',465, "ssl");
$transport->setUsername("events@swype.co.ke");
$transport->setPassword("swype@2017");
$mailer = new Swift_Mailer($transport);
return $mailer;
}
function emailSlip($data) {
//$filepath= createPdf($data["body"],$data["document"]);
$message = Swift_Message::newInstance()
->setFrom('')
->setTo("washiwaweru@gmail.com")
->setCc("washwaweru@gmail.com")
->setSubject("Email Subject");
/* $message->attach(
Swift_Attachment::fromPath($filepath)
);*/
/* $message ->setBody($data["extra"]);
$response=getMailer()->send($message);
return $response;
}
if($response){
echo 'sent';
}
else{
echo 'error';
}
}
*/
include_once "swift_required.php";
$transport = Swift_SmtpTransport::newInstance('swype.co.ke', 465, "ssl")
->setUsername('events@swype.co.ke')
->setPassword('swype@2017');
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Event Genius')
->setFrom(array('washiwaweru@gmail.com' => 'Admin'))
->setTo(array('washiwaweru@gmail.com' => 'Washi Waweru'))
->setBody("hello, \n An account has been created for you as a merchant at event genius \n UserName : washiwaweru@gmail.com \n Password: 1224 .");
//$attachment = Swift_Attachment::newInstance(file_get_contents('path/logo.png'), 'logo.png');
//$message->attach($attachment);
$numSent = $mailer->send($message);
printf("Sent %d messages\n", $numSent);
}
?>
<html>
<head></head>
<body>
<form action="" method="post">
<input type="submit" name="send">
</form>
</body>