Note that there are some explanatory texts on larger screens.

plurals
  1. POPHPMailer - PHP Error
    primarykey
    data
    text
    <pre><code>PHP Fatal error: Class 'Mail' not found in /.............../crons/Mail.php on line 2 </code></pre> <p>Any idea why it says 'Mail' when it's not mentioned in the code? Here's my PHP script:</p> <pre><code>&lt;?php require("database.php"); include_once("Mail.php"); $query = $db-&gt;query("SELECT * FROM `emails` WHERE `sent`='0' LIMIT 50"); if ($query-&gt;rowCount()&gt;=1) { while($row = $query-&gt;fetch(PDO::FETCH_ASSOC)) { $email = stripslashes($row['message']); //Create a new PHPMailer instance $mail = new PHPMailer(); $mail-&gt;isSMTP(); //Enable SMTP debugging // 0 = off (for production use) // 1 = client messages // 2 = client and server messages $mail-&gt;SMTPDebug = 2; //Ask for HTML-friendly debug output $mail-&gt;Debugoutput = 'html'; //Set the hostname of the mail server $mail-&gt;Host = 'localhost'; //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission $mail-&gt;Port = 25; //Set the encryption system to use - ssl (deprecated) or tls $mail-&gt;SMTPSecure = 'tls'; //Whether to use SMTP authentication $mail-&gt;SMTPAuth = true; //Username to use for SMTP authentication - use full email address for gmail $mail-&gt;Username = "help@pingrglobe.com"; //Password to use for SMTP authentication $mail-&gt;Password = "ping123rglobe"; //Set who the message is to be sent from $mail-&gt;setFrom('help@pingrglobe.com', 'PingrGlobe Support'); //Set an alternative reply-to address $mail-&gt;addReplyTo('help@pingrglobe.com', 'PingrGlobe Support'); //Set who the message is to be sent to $mail-&gt;addAddress($row['email'], 'John Doe'); //Set the subject line $mail-&gt;Subject = $row['subject']; //Replace the plain text body with one created manually $mail-&gt;Body = $email; //send down here etc </code></pre> <p>So basically, I got this code and I get the error as stated above the code, and it's not doing anything. Brand new PHPMailer download, "Mail" is not even a class being used, I'm confused.</p> <p>You might need the first few lines of Mail.php:</p> <pre><code>&lt;?php /** * PHPMailer - PHP email creation and transport class. * PHP Version 5.0.0 * Version 5.2.7 * @package PHPMailer * @link https://github.com/PHPMailer/PHPMailer/ * @author Marcus Bointon (coolbru) &lt;phpmailer@synchromedia.co.uk&gt; * @author Jim Jagielski (jimjag) &lt;jimjag@gmail.com&gt; * @author Andy Prevost (codeworxtech) &lt;codeworxtech@users.sourceforge.net&gt; * @author Brent R. Matzelle (original founder) * @copyright 2013 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ if (version_compare(PHP_VERSION, '5.0.0', '&lt;')) { exit("Sorry, PHPMailer will only run on PHP version 5 or greater!\n"); } /** * PHPMailer - PHP email creation and transport class. * PHP Version 5.0.0 * @package PHPMailer * @author Marcus Bointon (coolbru) &lt;phpmailer@synchromedia.co.uk&gt; * @author Jim Jagielski (jimjag) &lt;jimjag@gmail.com&gt; * @author Andy Prevost (codeworxtech) &lt;codeworxtech@users.sourceforge.net&gt; * @author Brent R. Matzelle (original founder) * @copyright 2013 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost */ class PHPMailer { /** * The PHPMailer Version number. * @type string */ public $Version = '5.2.7'; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload