HEX
Server: LiteSpeed
System: Linux server137.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: bibuzptr (1123)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/bibuzptr/elearning.bibu-edu.us/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>