Send email with PHPMailer and Cron (Ubuntu)

1

To schedule email submissions, do you have to do something other than put the file inside the /etc/cron.daily folder (for daily submissions)? This code works when I run directly on the server, do I need to edit some other file to send the scheduled?

<?php
    require 'http://insidetv.net.br/PHPMailer/class.phpmailer.php';

    $email = new PHPMailer();

    $email -> IsSMTP();
    $email -> Mailer = 'smtp';
    $email -> SMTPAuth = true;
    $email -> Host = 'smtp.gmail.com';
    $email -> Port = 465;
    $email -> SMTPSecure = 'ssl';
    $email -> CharSet = 'UTF-8';

    $email -> Username = "[email protected]";
    $email -> Password = "********";

    $email -> IsHTML(true);
    $email -> SingleTo = true;

    $email -> From = "[email protected]";
    $email -> FromName = "InsideTv";

    $email -> addAddress("[email protected]");

    $email -> Subject = "teste";
    $email -> Body = "teste";
    $email -> send();
?>
    
asked by anonymous 30.03.2017 / 03:31

0 answers