Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I want pass a variable to a property inside a class I just used in a a
- include statement
- How do I do that. This is what I have (not working)
- tclass.php mail program calls the class is nspace.php
- In tclass.php I am trying to pass variables to the class, this is a test.
- **tclass.php**
- <?php
- include_once('C:xampphtdocsnspace3.php');
- $mail->setFrom("jperson19468@gmail.com", "Mailer");
- ?>
- **nspace3.php**
- <?php
- $mail->SMTPDebug = 0; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'xxxxxxxxxx' // SMTP username
- $mail->Password = 'xxxxxxx'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- //Recipients
- $mail->addAddress('jperson19468@gmail.com', 'Joe User'); // Add a recipient
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Here is a Test3';
- $mail->Body = 'I hope this works <b>It works!!</b>';
- $mail->send();
- echo 'Message has been sent';
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
Add Comment
Please, Sign In to add comment