Advertisement
Guest User

cc

a guest
Jan 16th, 2020
2,403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.78 KB | None | 0 0
  1. <?php
  2. /**
  3. * Leaf PHP Mailer by [leafmailer.pw]
  4. * @version : 2.7
  5. **/
  6.  
  7. $password = ""; // Password
  8.  
  9. session_start();
  10. error_reporting(0);
  11. set_time_limit(0);
  12. ini_set("memory_limit",-1);
  13.  
  14.  
  15. $leaf['version']="2.7";
  16. $leaf['website']="leafmailer.pw";
  17.  
  18.  
  19. $sessioncode = md5(__FILE__);
  20. if(!empty($password) and $_SESSION[$sessioncode] != $password){
  21. # _REQUEST mean _POST or _GET
  22. if (isset($_REQUEST['pass']) and $_REQUEST['pass'] == $password) {
  23. $_SESSION[$sessioncode] = $password;
  24. }
  25. else {
  26. print "<pre align=center><form method=post>Password: <input type='password' name='pass'><input type='submit' value='>>'></form></pre>";
  27. exit;
  28. }
  29. }
  30.  
  31. if($_POST['action']=="send"){
  32. $senderEmail=leafTrim($_POST['senderEmail']);
  33. $senderName=leafTrim($_POST['senderName']);
  34. $replyTo=leafTrim($_POST['replyTo']);
  35. $subject=leafTrim($_POST['subject']);
  36. $emailList=leafTrim($_POST['emailList']);
  37. $messageType=leafTrim($_POST['messageType']);
  38. $messageLetter=leafTrim($_POST['messageLetter']);
  39. $messageLetter = urlencode($messageLetter);
  40. $messageLetter = ereg_replace("%5C%22", "%22", $messageLetter);
  41. $messageLetter = urldecode($messageLetter);
  42. $messageLetter = stripslashes($messageLetter);
  43. $subject = stripslashes($subject);
  44. $encode = stripslashes($encode);
  45.  
  46.  
  47. }
  48. if($messageType==2){
  49. $plain="checked";
  50. }
  51. else {
  52. $html="checked";
  53. }
  54.  
  55. function leafClear($text,$email){
  56. $emailuser = preg_replace('/([^@]*).*/', '$1', $email);
  57. $text = str_replace("[-time-]", date("m/d/Y h:i:s a", time()), $text);
  58. $text = str_replace("[-email-]", $email, $text);
  59. $text = str_replace("[-emailuser-]", $emailuser, $text);
  60. $text = str_replace("[-randomletters-]", randString('abcdefghijklmnopqrstuvwxyz'), $text);
  61. $text = str_replace("[-randomstring-]", randString('abcdefghijklmnopqrstuvwxyz0123456789'), $text);
  62. $text = str_replace("[-randomnumber-]", randString('0123456789'), $text);
  63. $text = str_replace("[-randommd5-]", md5(randString('abcdefghijklmnopqrstuvwxyz0123456789')), $text);
  64. return $text;
  65.  
  66. }
  67. function leafTrim($string){
  68. return stripslashes(ltrim(rtrim($string)));
  69. }
  70. function randString($consonants) {
  71. $length=rand(12,25);
  72. $password = '';
  73. for ($i = 0; $i < $length; $i++) {
  74. $password .= $consonants[(rand() % strlen($consonants))];
  75. }
  76. return $password;
  77. }
  78. function leafMailCheck($email){
  79. $exp = "^[a-z\'0-9]+([._-][a-z\'0-9]+)*@([a-z0-9]+([._-][a-z0-9]+))+$";
  80. if(eregi($exp,$email)){
  81. if(checkdnsrr(array_pop(explode("@",$email)),"MX")){return true;}
  82. else{return false;}
  83. }
  84. else{return false;}
  85. }
  86.  
  87. class PHPMailer
  88. {
  89. /**
  90. * The PHPMailer Version number.
  91. * @var string
  92. */
  93. public $Version = '5.2.14';
  94.  
  95. /**
  96. * Email priority.
  97. * Options: null (default), 1 = High, 3 = Normal, 5 = low.
  98. * When null, the header is not set at all.
  99. * @var integer
  100. */
  101. public $Priority = null;
  102.  
  103. /**
  104. * The character set of the message.
  105. * @var string
  106. */
  107. public $CharSet = 'iso-8859-1';
  108.  
  109. /**
  110. * The MIME Content-type of the message.
  111. * @var string
  112. */
  113. public $ContentType = 'text/plain';
  114.  
  115. /**
  116. * The message encoding.
  117. * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
  118. * @var string
  119. */
  120. public $Encoding = '8bit';
  121.  
  122. /**
  123. * Holds the most recent mailer error message.
  124. * @var string
  125. */
  126. public $ErrorInfo = '';
  127.  
  128. /**
  129. * The From email address for the message.
  130. * @var string
  131. */
  132. public $From = 'root@localhost';
  133.  
  134. /**
  135. * The From name of the message.
  136. * @var string
  137. */
  138. public $FromName = 'Root User';
  139.  
  140. /**
  141. * The Sender email (Return-Path) of the message.
  142. * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
  143. * @var string
  144. */
  145. public $Sender = '';
  146.  
  147. /**
  148. * The Return-Path of the message.
  149. * If empty, it will be set to either From or Sender.
  150. * @var string
  151. * @deprecated Email senders should never set a return-path header;
  152. * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything.
  153. * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference
  154. */
  155. public $ReturnPath = '';
  156.  
  157. /**
  158. * The Subject of the message.
  159. * @var string
  160. */
  161. public $Subject = '';
  162.  
  163. /**
  164. * An HTML or plain text message body.
  165. * If HTML then call isHTML(true).
  166. * @var string
  167. */
  168. public $Body = '';
  169.  
  170. /**
  171. * The plain-text message body.
  172. * This body can be read by mail clients that do not have HTML email
  173. * capability such as mutt & Eudora.
  174. * Clients that can read HTML will view the normal Body.
  175. * @var string
  176. */
  177. public $AltBody = '';
  178.  
  179. /**
  180. * An iCal message part body.
  181. * Only supported in simple alt or alt_inline message types
  182. * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator
  183. * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
  184. * @link http://kigkonsult.se/iCalcreator/
  185. * @var string
  186. */
  187. public $Ical = '';
  188.  
  189. /**
  190. * The complete compiled MIME message body.
  191. * @access protected
  192. * @var string
  193. */
  194. protected $MIMEBody = '';
  195.  
  196. /**
  197. * The complete compiled MIME message headers.
  198. * @var string
  199. * @access protected
  200. */
  201. protected $MIMEHeader = '';
  202.  
  203. /**
  204. * Extra headers that createHeader() doesn't fold in.
  205. * @var string
  206. * @access protected
  207. */
  208. protected $mailHeader = '';
  209.  
  210. /**
  211. * Word-wrap the message body to this number of chars.
  212. * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
  213. * @var integer
  214. */
  215. public $WordWrap = 0;
  216.  
  217. /**
  218. * Which method to use to send mail.
  219. * Options: "mail", "sendmail", or "smtp".
  220. * @var string
  221. */
  222. public $Mailer = 'mail';
  223.  
  224. /**
  225. * The path to the sendmail program.
  226. * @var string
  227. */
  228. public $Sendmail = '/usr/sbin/sendmail';
  229.  
  230. /**
  231. * Whether mail() uses a fully sendmail-compatible MTA.
  232. * One which supports sendmail's "-oi -f" options.
  233. * @var boolean
  234. */
  235. public $UseSendmailOptions = true;
  236.  
  237. /**
  238. * Path to PHPMailer plugins.
  239. * Useful if the SMTP class is not in the PHP include path.
  240. * @var string
  241. * @deprecated Should not be needed now there is an autoloader.
  242. */
  243. public $PluginDir = '';
  244.  
  245. /**
  246. * The email address that a reading confirmation should be sent to, also known as read receipt.
  247. * @var string
  248. */
  249. public $ConfirmReadingTo = '';
  250.  
  251. /**
  252. * The hostname to use in the Message-ID header and as default HELO string.
  253. * If empty, PHPMailer attempts to find one with, in order,
  254. * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value
  255. * 'localhost.localdomain'.
  256. * @var string
  257. */
  258. public $Hostname = '';
  259.  
  260. /**
  261. * An ID to be used in the Message-ID header.
  262. * If empty, a unique id will be generated.
  263. * @var string
  264. */
  265. public $MessageID = '';
  266.  
  267. /**
  268. * The message Date to be used in the Date header.
  269. * If empty, the current date will be added.
  270. * @var string
  271. */
  272. public $MessageDate = '';
  273.  
  274. /**
  275. * SMTP hosts.
  276. * Either a single hostname or multiple semicolon-delimited hostnames.
  277. * You can also specify a different port
  278. * for each host by using this format: [hostname:port]
  279. * (e.g. "smtp1.example.com:25;smtp2.example.com").
  280. * You can also specify encryption type, for example:
  281. * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
  282. * Hosts will be tried in order.
  283. * @var string
  284. */
  285. public $Host = 'localhost';
  286.  
  287. /**
  288. * The default SMTP server port.
  289. * @var integer
  290. * @TODO Why is this needed when the SMTP class takes care of it?
  291. */
  292. public $Port = 25;
  293.  
  294. /**
  295. * The SMTP HELO of the message.
  296. * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find
  297. * one with the same method described above for $Hostname.
  298. * @var string
  299. * @see PHPMailer::$Hostname
  300. */
  301. public $Helo = '';
  302.  
  303. /**
  304. * What kind of encryption to use on the SMTP connection.
  305. * Options: '', 'ssl' or 'tls'
  306. * @var string
  307. */
  308. public $SMTPSecure = '';
  309.  
  310. /**
  311. * Whether to enable TLS encryption automatically if a server supports it,
  312. * even if `SMTPSecure` is not set to 'tls'.
  313. * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
  314. * @var boolean
  315. */
  316. public $SMTPAutoTLS = true;
  317.  
  318. /**
  319. * Whether to use SMTP authentication.
  320. * Uses the Username and Password properties.
  321. * @var boolean
  322. * @see PHPMailer::$Username
  323. * @see PHPMailer::$Password
  324. */
  325. public $SMTPAuth = false;
  326.  
  327. /**
  328. * Options array passed to stream_context_create when connecting via SMTP.
  329. * @var array
  330. */
  331. public $SMTPOptions = array();
  332.  
  333. /**
  334. * SMTP username.
  335. * @var string
  336. */
  337. public $Username = '';
  338.  
  339. /**
  340. * SMTP password.
  341. * @var string
  342. */
  343. public $Password = '';
  344.  
  345. /**
  346. * SMTP auth type.
  347. * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
  348. * @var string
  349. */
  350. public $AuthType = '';
  351.  
  352. /**
  353. * SMTP realm.
  354. * Used for NTLM auth
  355. * @var string
  356. */
  357. public $Realm = '';
  358.  
  359. /**
  360. * SMTP workstation.
  361. * Used for NTLM auth
  362. * @var string
  363. */
  364. public $Workstation = '';
  365.  
  366. /**
  367. * The SMTP server timeout in seconds.
  368. * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
  369. * @var integer
  370. */
  371. public $Timeout = 300;
  372.  
  373. /**
  374. * SMTP class debug output mode.
  375. * Debug output level.
  376. * Options:
  377. * * `0` No output
  378. * * `1` Commands
  379. * * `2` Data and commands
  380. * * `3` As 2 plus connection status
  381. * * `4` Low-level data output
  382. * @var integer
  383. * @see SMTP::$do_debug
  384. */
  385. public $SMTPDebug = 0;
  386.  
  387. /**
  388. * How to handle debug output.
  389. * Options:
  390. * * `echo` Output plain-text as-is, appropriate for CLI
  391. * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
  392. * * `error_log` Output to error log as configured in php.ini
  393. *
  394. * Alternatively, you can provide a callable expecting two params: a message string and the debug level:
  395. * <code>
  396. * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
  397. * </code>
  398. * @var string|callable
  399. * @see SMTP::$Debugoutput
  400. */
  401. public $Debugoutput = 'echo';
  402.  
  403. /**
  404. * Whether to keep SMTP connection open after each message.
  405. * If this is set to true then to close the connection
  406. * requires an explicit call to smtpClose().
  407. * @var boolean
  408. */
  409. public $SMTPKeepAlive = false;
  410.  
  411. /**
  412. * Whether to split multiple to addresses into multiple messages
  413. * or send them all in one message.
  414. * @var boolean
  415. */
  416. public $SingleTo = false;
  417.  
  418. /**
  419. * Storage for addresses when SingleTo is enabled.
  420. * @var array
  421. * @TODO This should really not be public
  422. */
  423. public $SingleToArray = array();
  424.  
  425. /**
  426. * Whether to generate VERP addresses on send.
  427. * Only applicable when sending via SMTP.
  428. * @link https://en.wikipedia.org/wiki/Variable_envelope_return_path
  429. * @link http://www.postfix.org/VERP_README.html Postfix VERP info
  430. * @var boolean
  431. */
  432. public $do_verp = false;
  433.  
  434. /**
  435. * Whether to allow sending messages with an empty body.
  436. * @var boolean
  437. */
  438. public $AllowEmpty = false;
  439.  
  440. /**
  441. * The default line ending.
  442. * @note The default remains "\n". We force CRLF where we know
  443. * it must be used via self::CRLF.
  444. * @var string
  445. */
  446. public $LE = "\n";
  447.  
  448. /**
  449. * DKIM selector.
  450. * @var string
  451. */
  452. public $DKIM_selector = '';
  453.  
  454. /**
  455. * DKIM Identity.
  456. * Usually the email address used as the source of the email
  457. * @var string
  458. */
  459. public $DKIM_identity = '';
  460.  
  461. /**
  462. * DKIM passphrase.
  463. * Used if your key is encrypted.
  464. * @var string
  465. */
  466. public $DKIM_passphrase = '';
  467.  
  468. /**
  469. * DKIM signing domain name.
  470. * @example 'example.com'
  471. * @var string
  472. */
  473. public $DKIM_domain = '';
  474.  
  475. /**
  476. * DKIM private key file path.
  477. * @var string
  478. */
  479. public $DKIM_private = '';
  480.  
  481. /**
  482. * Callback Action function name.
  483. *
  484. * The function that handles the result of the send email action.
  485. * It is called out by send() for each email sent.
  486. *
  487. * Value can be any php callable: http://www.php.net/is_callable
  488. *
  489. * Parameters:
  490. * boolean $result result of the send action
  491. * string $to email address of the recipient
  492. * string $cc cc email addresses
  493. * string $bcc bcc email addresses
  494. * string $subject the subject
  495. * string $body the email body
  496. * string $from email address of sender
  497. * @var string
  498. */
  499. public $action_function = '';
  500.  
  501. /**
  502. * What to put in the X-Mailer header.
  503. * Options: An empty string for PHPMailer default, whitespace for none, or a string to use
  504. * @var string
  505. */
  506. public $XMailer = '';
  507.  
  508. /**
  509. * An instance of the SMTP sender class.
  510. * @var SMTP
  511. * @access protected
  512. */
  513. protected $smtp = null;
  514.  
  515. /**
  516. * The array of 'to' names and addresses.
  517. * @var array
  518. * @access protected
  519. */
  520. protected $to = array();
  521.  
  522. /**
  523. * The array of 'cc' names and addresses.
  524. * @var array
  525. * @access protected
  526. */
  527. protected $cc = array();
  528.  
  529. /**
  530. * The array of 'bcc' names and addresses.
  531. * @var array
  532. * @access protected
  533. */
  534. protected $bcc = array();
  535.  
  536. /**
  537. * The array of reply-to names and addresses.
  538. * @var array
  539. * @access protected
  540. */
  541. protected $ReplyTo = array();
  542.  
  543. /**
  544. * An array of all kinds of addresses.
  545. * Includes all of $to, $cc, $bcc
  546. * @var array
  547. * @access protected
  548. * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
  549. */
  550. protected $all_recipients = array();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement