Guest User

Untitled

a guest
Nov 26th, 2017
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. I want pass a variable to a property inside a class I just used in a a
  2. include statement
  3. How do I do that. This is what I have (not working)
  4. tclass.php mail program calls the class is nspace.php
  5. In tclass.php I am trying to pass variables to the class, this is a test.
  6.  
  7. **tclass.php**
  8.  
  9. <?php
  10. include_once('C:xampphtdocsnspace3.php');
  11. $mail->setFrom("jperson19468@gmail.com", "Mailer");
  12. ?>
  13. **nspace3.php**
  14.  
  15. <?php
  16.  
  17. $mail->SMTPDebug = 0; // Enable verbose debug output
  18.  
  19. $mail->isSMTP(); // Set mailer to use SMTP
  20.  
  21. $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  22.  
  23. $mail->SMTPAuth = true; // Enable SMTP authentication
  24.  
  25. $mail->Username = 'xxxxxxxxxx' // SMTP username
  26.  
  27. $mail->Password = 'xxxxxxx'; // SMTP password
  28.  
  29. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  30.  
  31. $mail->Port = 587; // TCP port to connect to
  32.  
  33. //Recipients
  34.  
  35. $mail->addAddress('jperson19468@gmail.com', 'Joe User'); // Add a recipient
  36.  
  37. //Content
  38. $mail->isHTML(true); // Set email format to HTML
  39. $mail->Subject = 'Here is a Test3';
  40. $mail->Body = 'I hope this works <b>It works!!</b>';
  41.  
  42. $mail->send();
  43. echo 'Message has been sent';
  44.  
  45. echo 'Message could not be sent.';
  46. echo 'Mailer Error: ' . $mail->ErrorInfo;
Add Comment
Please, Sign In to add comment