10 | * @author Brent R. Matzelle (original founder)
11 | * @copyright 2012 - 2014 Marcus Bointon
12 | * @copyright 2010 - 2012 Jim Jagielski
13 | * @copyright 2004 - 2009 Andy Prevost
14 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 | * @note This program is distributed in the hope that it will be useful - WITHOUT
16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 | * FITNESS FOR A PARTICULAR PURPOSE.
18 | */
19 |
20 | /**
21 | * PHPMailer SPL autoloader.
22 | * @param string $classname The name of the class to load
23 | */
24 | function PHPMailerAutoload($classname)
25 | {
26 | //Can't use __DIR__ as it's only in PHP 5.3+
27 | $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
28 | if (is_readable($filename)) {
29 | require $filename;
30 | }
31 | }
32 |
33 | if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
34 | //SPL autoloading was introduced in PHP 5.1.2
35 | if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
36 | spl_autoload_register('PHPMailerAutoload', true, true);
37 | } else {
38 | spl_autoload_register('PHPMailerAutoload');
39 | }
40 | } else {
41 | /**
42 | * Fall back to traditional autoload for old PHP versions
43 | * @param string $classname The name of the class to load
44 | */
45 | function __autoload($classname)
46 | {
47 | PHPMailerAutoload($classname);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/PHPMailer/VERSION:
--------------------------------------------------------------------------------
1 | 5.2.9
--------------------------------------------------------------------------------
/PHPMailer/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "phpmailer/phpmailer",
3 | "type": "library",
4 | "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
5 | "authors": [
6 | {
7 | "name": "Marcus Bointon",
8 | "email": "phpmailer@synchromedia.co.uk"
9 | },
10 | {
11 | "name": "Jim Jagielski",
12 | "email": "jimjag@gmail.com"
13 | },
14 | {
15 | "name": "Andy Prevost",
16 | "email": "codeworxtech@users.sourceforge.net"
17 | },
18 | {
19 | "name": "Brent R. Matzelle"
20 | }
21 | ],
22 | "require": {
23 | "php": ">=5.0.0"
24 | },
25 | "require-dev": {
26 | "phpdocumentor/phpdocumentor": "*",
27 | "phpunit/phpunit": "4.1.*"
28 | },
29 | "autoload": {
30 | "classmap": ["class.phpmailer.php", "class.pop3.php", "class.smtp.php"]
31 | },
32 | "license": "LGPL-2.1"
33 | }
--------------------------------------------------------------------------------
/PHPMailer/docs/Callback_function_notes.txt:
--------------------------------------------------------------------------------
1 | NEW CALLBACK FUNCTION:
2 | ======================
3 |
4 | We have had requests for a method to process the results of sending emails
5 | through PHPMailer. In this new release, we have implemented a callback
6 | function that passes the results of each email sent (to, cc, and/or bcc).
7 | We have provided an example that echos the results back to the screen. The
8 | callback function can be used for any purpose. With minor modifications, the
9 | callback function can be used to create CSV logs, post results to databases,
10 | etc.
11 |
12 | Please review the test.php script for the example.
13 |
14 | It's pretty straight forward.
15 |
16 | Enjoy!
17 | Andy
18 |
--------------------------------------------------------------------------------
/PHPMailer/docs/DomainKeys_notes.txt:
--------------------------------------------------------------------------------
1 | CREATE DKIM KEYS and DNS Resource Record:
2 | =========================================
3 |
4 | To create DomainKeys Identified Mail keys, visit:
5 | http://dkim.worxware.com/
6 | ... read the information, fill in the form, and download the ZIP file
7 | containing the public key, private key, DNS Resource Record and instructions
8 | to add to your DNS Zone Record, and the PHPMailer code to enable DKIM
9 | digital signing.
10 |
11 | /*** PROTECT YOUR PRIVATE & PUBLIC KEYS ***/
12 |
13 | You need to protect your DKIM private and public keys from being viewed or
14 | accessed. Add protection to your .htaccess file as in this example:
15 |
16 | # secure htkeyprivate file
17 |
18 | order allow,deny
19 | deny from all
20 |
21 |
22 | # secure htkeypublic file
23 |
24 | order allow,deny
25 | deny from all
26 |
27 |
28 | (the actual .htaccess additions are in the ZIP file sent back to you from
29 | http://dkim.worxware.com/
30 |
31 | A few notes on using DomainKey Identified Mail (DKIM):
32 |
33 | You do not need to use PHPMailer to DKIM sign emails IF:
34 | - you enable DomainKey support and add the DNS resource record
35 | - you use your outbound mail server
36 |
37 | If you are a third-party emailer that works on behalf of domain owners to
38 | send their emails from your own server:
39 | - you absolutely have to DKIM sign outbound emails
40 | - the domain owner has to add the DNS resource record to match the
41 | private key, public key, selector, identity, and domain that you create
42 | - use caution with the "selector" ... at least one "selector" will already
43 | exist in the DNS Zone Record of the domain at the domain owner's server
44 | you need to ensure that the "selector" you use is unique
45 | Note: since the IP address will not match the domain owner's DNS Zone record
46 | you can be certain that email providers that validate based on DomainKey will
47 | check the domain owner's DNS Zone record for your DNS resource record. Before
48 | sending out emails on behalf of domain owners, ensure they have entered the
49 | DNS resource record you provided them.
50 |
51 | Enjoy!
52 | Andy
53 |
54 | PS. if you need additional information about DKIM, please see:
55 | http://www.dkim.org/info/dkim-faq.html
56 |
--------------------------------------------------------------------------------
/PHPMailer/docs/Note_for_SMTP_debugging.txt:
--------------------------------------------------------------------------------
1 | If you are having problems connecting or sending emails through your SMTP server, the SMTP class can provide more information about the processing/errors taking place.
2 | Use the debug functionality of the class to see what's going on in your connections. To do that, set the debug level in your script. For example:
3 |
4 | $mail->SMTPDebug = 1;
5 | $mail->isSMTP(); // telling the class to use SMTP
6 | $mail->SMTPAuth = true; // enable SMTP authentication
7 | $mail->Port = 26; // set the SMTP port
8 | $mail->Host = "mail.yourhost.com"; // SMTP server
9 | $mail->Username = "name@yourhost.com"; // SMTP account username
10 | $mail->Password = "your password"; // SMTP account password
11 |
12 | Notes on this:
13 | $mail->SMTPDebug = 0; ... will disable debugging (you can also leave this out completely, 0 is the default)
14 | $mail->SMTPDebug = 1; ... will echo errors and server responses
15 | $mail->SMTPDebug = 2; ... will echo errors, server responses and client messages
16 |
17 | And finally, don't forget to disable debugging before going into production.
18 |
--------------------------------------------------------------------------------
/PHPMailer/docs/extending.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Examples using phpmailer
4 |
5 |
6 |
7 |
8 | Examples using PHPMailer
9 |
10 | 1. Advanced Example
11 |
12 |
13 | This demonstrates sending multiple email messages with binary attachments
14 | from a MySQL database using multipart/alternative messages.
15 |
16 |
17 | require 'PHPMailerAutoload.php';
18 |
19 | $mail = new PHPMailer();
20 |
21 | $mail->From = 'list@example.com';
22 | $mail->FromName = 'List manager';
23 | $mail->Host = 'smtp1.example.com;smtp2.example.com';
24 | $mail->Mailer = 'smtp';
25 |
26 | @mysqli_connect('localhost','root','password');
27 | @mysqli_select_db("my_company");
28 | $query = "SELECT full_name, email, photo FROM employee";
29 | $result = @mysqli_query($query);
30 |
31 | while ($row = mysqli_fetch_assoc($result))
32 | {
33 | // HTML body
34 | $body = "Hello <font size=\"4\">" . $row['full_name'] . "</font>, <p>";
35 | $body .= "<i>Your</i> personal photograph to this message.<p>";
36 | $body .= "Sincerely, <br>";
37 | $body .= "phpmailer List manager";
38 |
39 | // Plain text body (for mail clients that cannot read HTML)
40 | $text_body = 'Hello ' . $row['full_name'] . ", \n\n";
41 | $text_body .= "Your personal photograph to this message.\n\n";
42 | $text_body .= "Sincerely, \n";
43 | $text_body .= 'phpmailer List manager';
44 |
45 | $mail->Body = $body;
46 | $mail->AltBody = $text_body;
47 | $mail->addAddress($row['email'], $row['full_name']);
48 | $mail->addStringAttachment($row['photo'], 'YourPhoto.jpg');
49 |
50 | if(!$mail->send())
51 | echo "There has been a mail error sending to " . $row['email'] . "<br>";
52 |
53 | // Clear all addresses and attachments for next loop
54 | $mail->clearAddresses();
55 | $mail->clearAttachments();
56 | }
57 |
58 |
59 |
60 |
2. Extending PHPMailer
61 |
62 |
63 | Extending classes with inheritance is one of the most
64 | powerful features of object-oriented programming. It allows you to make changes to the
65 | original class for your own personal use without hacking the original
66 | classes, and it's very easy to do:
67 |
68 |
69 | Here's a class that extends the phpmailer class and sets the defaults
70 | for the particular site:
71 | PHP include file: my_phpmailer.php
72 |
73 |
74 |
75 | require 'PHPMailerAutoload.php';
76 |
77 | class my_phpmailer extends PHPMailer {
78 | // Set default variables for all new objects
79 | public $From = 'from@example.com';
80 | public $FromName = 'Mailer';
81 | public $Host = 'smtp1.example.com;smtp2.example.com';
82 | public $Mailer = 'smtp'; // Alternative to isSMTP()
83 | public $WordWrap = 75;
84 |
85 | // Replace the default debug output function
86 | protected function edebug($msg) {
87 | print('My Site Error');
88 | print('Description:');
89 | printf('%s', $msg);
90 | exit;
91 | }
92 |
93 | //Extend the send function
94 | public function send() {
95 | $this->Subject = '[Yay for me!] '.$this->Subject;
96 | return parent::send()
97 | }
98 |
99 | // Create an additional function
100 | public function do_something($something) {
101 | // Place your new code here
102 | }
103 | }
104 |
105 |
106 | Now here's a normal PHP page in the site, which will have all the defaults set above:
107 |
108 |
109 | require 'my_phpmailer.php';
110 |
111 | // Instantiate your new class
112 | $mail = new my_phpmailer;
113 |
114 | // Now you only need to add the necessary stuff
115 | $mail->addAddress('josh@example.com', 'Josh Adams');
116 | $mail->Subject = 'Here is the subject';
117 | $mail->Body = 'This is the message body';
118 | $mail->addAttachment('c:/temp/11-10-00.zip', 'new_name.zip'); // optional name
119 |
120 | if(!$mail->send())
121 | {
122 | echo 'There was an error sending the message';
123 | exit;
124 | }
125 |
126 | echo 'Message was sent successfully';
127 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/PHPMailer/docs/faq.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | PHPMailer FAQ
4 |
5 |
6 | PHPMailer FAQ
7 |
8 | - Q: I am concerned that using include files will take up too much
9 | processing time on my computer. How can I make it run faster?
10 | A: PHP by itself is fairly fast, but it recompiles scripts every time they are run, which takes up valuable
11 | computer resources. You can bypass this by using an opcode cache which compiles
12 | PHP code and store it in memory to reduce overhead immensely. APC
13 | (Alternative PHP Cache) is a free opcode cache extension in the PECL library.
14 | - Q: Which mailer gives me the best performance?
15 | A: On a single machine the sendmail (or Qmail) is fastest overall.
16 | Next fastest is mail() to give you the best performance. Both do not have the overhead of SMTP.
17 | If you do not have a local mail server (as is typical on Windows), SMTP is your only option.
18 | - Q: When I try to attach a file with on my server I get a
19 | "Could not find {file} on filesystem error". Why is this?
20 | A: If you are using a Unix machine this is probably because the user
21 | running your web server does not have read access to the directory in question. If you are using Windows,
22 | then the problem is probably that you have used single backslashes to denote directories (\).
23 | A single backslash has a special meaning to PHP so these are not
24 | valid. Instead use double backslashes ("\\") or a single forward
25 | slash ("/").
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/PHPMailer/docs/generatedocs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Regenerate PHPMailer documentation
3 | # Run from within the docs folder
4 | rm -rf phpdoc/*
5 | phpdoc --directory .. --target ./phpdoc --ignore test/,examples/,extras/,test_script/,vendor/,language/ --sourcecode --force --title PHPMailer --template="clean"
6 | # You can merge regenerated docs into a separate docs working copy without messing up the git status like so:
7 | # rsync -a --delete --exclude ".git" --exclude "phpdoc-cache-*/" --exclude "README.md" phpdoc/ ../../phpmailer-docs
8 | # After updating docs, push/PR them to the phpmailer gh-pages branch: https://github.com/PHPMailer/PHPMailer/tree/gh-pages
9 |
--------------------------------------------------------------------------------
/PHPMailer/docs/pop3_article.txt:
--------------------------------------------------------------------------------
1 | This is built for PHP Mailer 1.72 and was not tested with any previous version. It was developed under PHP 4.3.11 (E_ALL). It works under PHP 5 and 5.1 with E_ALL, but not in Strict mode due to var deprecation (but then neither does PHP Mailer either!). It follows the RFC 1939 standard explicitly and is fully commented.
2 |
3 | With that noted, here is how to implement it:
4 |
5 | I didn't want to modify the PHP Mailer classes at all, so you will have to include/require this class along with the base one. It can sit quite happily in the phpmailer directory.
6 |
7 | When you need it, create your POP3 object
8 |
9 | Right before I invoke PHP Mailer I activate the POP3 authorisation. POP3 before SMTP is a process whereby you login to your web hosts POP3 mail server BEFORE sending out any emails via SMTP. The POP3 logon 'verifies' your ability to send email by SMTP, which typically otherwise blocks you. On my web host (Pair Networks) a single POP3 logon is enough to 'verify' you for 90 minutes. Here is some sample PHP code that activates the POP3 logon and then sends an email via PHP Mailer:
10 |
11 | authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
13 | $mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->isSMTP();
14 | $mail->isHTML(false); $mail->Host = 'relay.example.com';
15 | $mail->From = 'mailer@example.com';
16 | $mail->FromName = 'Example Mailer';
17 | $mail->Subject = 'My subject';
18 | $mail->Body = 'Hello world';
19 | $mail->addAddress('rich@corephp.co.uk', 'Richard Davey');
20 | if (!$mail->send()) {
21 | echo $mail->ErrorInfo;
22 | }
23 | ?>
24 |
25 | The PHP Mailer parts of this code should be obvious to anyone who has used PHP Mailer before. One thing to note - you almost certainly will not need to use SMTP Authentication *and* POP3 before SMTP together. The Authorisation method is a proxy method to all of the others within that class. There are connect, Logon and disconnect methods available, but I wrapped them in the single Authorisation one to make things easier.
26 | The Parameters
27 |
28 | The authorise parameters are as follows:
29 |
30 | $pop->authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
31 |
32 | 1. pop3.example.com - The POP3 Mail Server Name (hostname or IP address)
33 | 2. 110 - The POP3 Port on which to connect (default is usually 110, but check with your host)
34 | 3. 30 - A connection time-out value (in seconds)
35 | 4. mailer - The POP3 Username required to logon
36 | 5. password - The POP3 Password required to logon
37 | 6. 1 - The class debug level (0 = off, 1+ = debug output is echoed to the browser)
38 |
39 | Final Comments + the Download
40 |
41 | 1) This class does not support APOP connections. This is only because I did not have an APOP server to test with, but if you'd like to see that added just contact me.
42 |
43 | 2) Opening and closing lots of POP3 connections can be quite a resource/network drain. If you need to send a whole batch of emails then just perform the authentication once at the start, and then loop through your mail sending script. Providing this process doesn't take longer than the verification period lasts on your POP3 server, you should be fine. With my host that period is 90 minutes, i.e. plenty of time.
44 |
45 | 3) If you have heavy requirements for this script (i.e. send a LOT of email on a frequent basis) then I would advise seeking out an alternative sending method (direct SMTP ideally). If this isn't possible then you could modify this class so the 'last authorised' date is recorded somewhere (MySQL, Flat file, etc) meaning you only open a new connection if the old one has expired, saving you precious overhead.
46 |
47 | 4) There are lots of other POP3 classes for PHP available. However most of them implement the full POP3 command set, where-as this one is purely for authentication, and much lighter as a result. However using any of the other POP3 classes to just logon to your server would have the same net result. At the end of the day, use whatever method you feel most comfortable with.
48 | Download
49 |
50 | My thanks to Chris Ryan for the inspiration (even if indirectly, via his SMTP class)
51 |
--------------------------------------------------------------------------------
/PHPMailer/examples/contents.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PHPMailer Test
6 |
7 |
8 |
9 |
This is a test of PHPMailer.
10 |
11 |

12 |
13 |
This example uses HTML.
14 |
The PHPMailer image at the top has been embedded automatically.
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PHPMailer/examples/exceptions.phps:
--------------------------------------------------------------------------------
1 | setFrom('from@example.com', 'First Last');
14 | //Set an alternative reply-to address
15 | $mail->addReplyTo('replyto@example.com', 'First Last');
16 | //Set who the message is to be sent to
17 | $mail->addAddress('whoto@example.com', 'John Doe');
18 | //Set the subject line
19 | $mail->Subject = 'PHPMailer Exceptions test';
20 | //Read an HTML message body from an external file, convert referenced images to embedded,
21 | //and convert the HTML into a basic plain-text alternative body
22 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
23 | //Replace the plain text body with one created manually
24 | $mail->AltBody = 'This is a plain-text message body';
25 | //Attach an image file
26 | $mail->addAttachment('images/phpmailer_mini.png');
27 | //send the message
28 | //Note that we don't need check the response from this because it will throw an exception if it has trouble
29 | $mail->send();
30 | echo "Message sent!";
31 | } catch (phpmailerException $e) {
32 | echo $e->errorMessage(); //Pretty error messages from PHPMailer
33 | } catch (Exception $e) {
34 | echo $e->getMessage(); //Boring error messages from anything else!
35 | }
36 |
--------------------------------------------------------------------------------
/PHPMailer/examples/gmail.phps:
--------------------------------------------------------------------------------
1 | isSMTP();
17 |
18 | //Enable SMTP debugging
19 | // 0 = off (for production use)
20 | // 1 = client messages
21 | // 2 = client and server messages
22 | $mail->SMTPDebug = 2;
23 |
24 | //Ask for HTML-friendly debug output
25 | $mail->Debugoutput = 'html';
26 |
27 | //Set the hostname of the mail server
28 | $mail->Host = 'smtp.gmail.com';
29 |
30 | //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
31 | $mail->Port = 587;
32 |
33 | //Set the encryption system to use - ssl (deprecated) or tls
34 | $mail->SMTPSecure = 'tls';
35 |
36 | //Whether to use SMTP authentication
37 | $mail->SMTPAuth = true;
38 |
39 | //Username to use for SMTP authentication - use full email address for gmail
40 | $mail->Username = "username@gmail.com";
41 |
42 | //Password to use for SMTP authentication
43 | $mail->Password = "yourpassword";
44 |
45 | //Set who the message is to be sent from
46 | $mail->setFrom('from@example.com', 'First Last');
47 |
48 | //Set an alternative reply-to address
49 | $mail->addReplyTo('replyto@example.com', 'First Last');
50 |
51 | //Set who the message is to be sent to
52 | $mail->addAddress('whoto@example.com', 'John Doe');
53 |
54 | //Set the subject line
55 | $mail->Subject = 'PHPMailer GMail SMTP test';
56 |
57 | //Read an HTML message body from an external file, convert referenced images to embedded,
58 | //convert HTML into a basic plain-text alternative body
59 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
60 |
61 | //Replace the plain text body with one created manually
62 | $mail->AltBody = 'This is a plain-text message body';
63 |
64 | //Attach an image file
65 | $mail->addAttachment('images/phpmailer_mini.png');
66 |
67 | //send the message, check for errors
68 | if (!$mail->send()) {
69 | echo "Mailer Error: " . $mail->ErrorInfo;
70 | } else {
71 | echo "Message sent!";
72 | }
73 |
--------------------------------------------------------------------------------
/PHPMailer/examples/images/phpmailer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudXNS/mss/3c7af06ef22f49b78f7f18a3ac69ef785ad7591f/PHPMailer/examples/images/phpmailer.png
--------------------------------------------------------------------------------
/PHPMailer/examples/images/phpmailer_mini.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudXNS/mss/3c7af06ef22f49b78f7f18a3ac69ef785ad7591f/PHPMailer/examples/images/phpmailer_mini.png
--------------------------------------------------------------------------------
/PHPMailer/examples/mail.phps:
--------------------------------------------------------------------------------
1 | setFrom('from@example.com', 'First Last');
12 | //Set an alternative reply-to address
13 | $mail->addReplyTo('replyto@example.com', 'First Last');
14 | //Set who the message is to be sent to
15 | $mail->addAddress('whoto@example.com', 'John Doe');
16 | //Set the subject line
17 | $mail->Subject = 'PHPMailer mail() test';
18 | //Read an HTML message body from an external file, convert referenced images to embedded,
19 | //convert HTML into a basic plain-text alternative body
20 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
21 | //Replace the plain text body with one created manually
22 | $mail->AltBody = 'This is a plain-text message body';
23 | //Attach an image file
24 | $mail->addAttachment('images/phpmailer_mini.png');
25 |
26 | //send the message, check for errors
27 | if (!$mail->send()) {
28 | echo "Mailer Error: " . $mail->ErrorInfo;
29 | } else {
30 | echo "Message sent!";
31 | }
32 |
--------------------------------------------------------------------------------
/PHPMailer/examples/mailing_list.phps:
--------------------------------------------------------------------------------
1 | isSMTP();
14 | $mail->Host = 'smtp.example.com';
15 | $mail->SMTPAuth = true;
16 | $mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent, reduces SMTP overhead
17 | $mail->Port = 25;
18 | $mail->Username = 'yourname@example.com';
19 | $mail->Password = 'yourpassword';
20 | $mail->setFrom('list@example.com', 'List manager');
21 | $mail->addReplyTo('list@example.com', 'List manager');
22 |
23 | $mail->Subject = "PHPMailer Simple database mailing list test";
24 |
25 | //Same body for all messages, so set this before the sending loop
26 | //If you generate a different body for each recipient (e.g. you're using a templating system),
27 | //set it inside the loop
28 | $mail->msgHTML($body);
29 | //msgHTML also sets AltBody, but if you want a custom one, set it afterwards
30 | $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
31 |
32 | //Connect to the database and select the recipients from your mailing list that have not yet been sent to
33 | //You'll need to alter this to match your database
34 | $mysql = mysqli_connect('localhost', 'username', 'password');
35 | mysqli_select_db($mysql, 'mydb');
36 | $result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = false');
37 |
38 | foreach ($result as $row) { //This iterator syntax only works in PHP 5.4+
39 | $mail->addAddress($row['email'], $row['full_name']);
40 | if (!empty($row['photo'])) {
41 | $mail->addStringAttachment($row['photo'], 'YourPhoto.jpg'); //Assumes the image data is stored in the DB
42 | }
43 |
44 | if (!$mail->send()) {
45 | echo "Mailer Error (" . str_replace("@", "@", $row["email"]) . ') ' . $mail->ErrorInfo . '
';
46 | break; //Abandon sending
47 | } else {
48 | echo "Message sent to :" . $row['full_name'] . ' (' . str_replace("@", "@", $row['email']) . ')
';
49 | //Mark it as sent in the DB
50 | mysqli_query(
51 | $mysql,
52 | "UPDATE mailinglist SET sent = true WHERE email = '" .
53 | mysqli_real_escape_string($mysql, $row['email']) . "'"
54 | );
55 | }
56 | // Clear all addresses and attachments for next loop
57 | $mail->clearAddresses();
58 | $mail->clearAttachments();
59 | }
60 |
--------------------------------------------------------------------------------
/PHPMailer/examples/pop_before_smtp.phps:
--------------------------------------------------------------------------------
1 | isSMTP();
18 | //Enable SMTP debugging
19 | // 0 = off (for production use)
20 | // 1 = client messages
21 | // 2 = client and server messages
22 | $mail->SMTPDebug = 2;
23 | //Ask for HTML-friendly debug output
24 | $mail->Debugoutput = 'html';
25 | //Set the hostname of the mail server
26 | $mail->Host = "mail.example.com";
27 | //Set the SMTP port number - likely to be 25, 465 or 587
28 | $mail->Port = 25;
29 | //Whether to use SMTP authentication
30 | $mail->SMTPAuth = false;
31 | //Set who the message is to be sent from
32 | $mail->setFrom('from@example.com', 'First Last');
33 | //Set an alternative reply-to address
34 | $mail->addReplyTo('replyto@example.com', 'First Last');
35 | //Set who the message is to be sent to
36 | $mail->addAddress('whoto@example.com', 'John Doe');
37 | //Set the subject line
38 | $mail->Subject = 'PHPMailer POP-before-SMTP test';
39 | //Read an HTML message body from an external file, convert referenced images to embedded,
40 | //and convert the HTML into a basic plain-text alternative body
41 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
42 | //Replace the plain text body with one created manually
43 | $mail->AltBody = 'This is a plain-text message body';
44 | //Attach an image file
45 | $mail->addAttachment('images/phpmailer_mini.png');
46 | //send the message
47 | //Note that we don't need check the response from this because it will throw an exception if it has trouble
48 | $mail->send();
49 | echo "Message sent!";
50 | } catch (phpmailerException $e) {
51 | echo $e->errorMessage(); //Pretty error messages from PHPMailer
52 | } catch (Exception $e) {
53 | echo $e->getMessage(); //Boring error messages from anything else!
54 | }
55 |
--------------------------------------------------------------------------------
/PHPMailer/examples/scripts/shAutoloader.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | var sh = SyntaxHighlighter;
4 |
5 | /**
6 | * Provides functionality to dynamically load only the brushes that a needed to render the current page.
7 | *
8 | * There are two syntaxes that autoload understands. For example:
9 | *
10 | * SyntaxHighlighter.autoloader(
11 | * [ 'applescript', 'Scripts/shBrushAppleScript.js' ],
12 | * [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ]
13 | * );
14 | *
15 | * or a more easily comprehendable one:
16 | *
17 | * SyntaxHighlighter.autoloader(
18 | * 'applescript Scripts/shBrushAppleScript.js',
19 | * 'actionscript3 as3 Scripts/shBrushAS3.js'
20 | * );
21 | */
22 | sh.autoloader = function()
23 | {
24 | var list = arguments,
25 | elements = sh.findElements(),
26 | brushes = {},
27 | scripts = {},
28 | all = SyntaxHighlighter.all,
29 | allCalled = false,
30 | allParams = null,
31 | i
32 | ;
33 |
34 | SyntaxHighlighter.all = function(params)
35 | {
36 | allParams = params;
37 | allCalled = true;
38 | };
39 |
40 | function addBrush(aliases, url)
41 | {
42 | for (var i = 0; i < aliases.length; i++)
43 | brushes[aliases[i]] = url;
44 | };
45 |
46 | function getAliases(item)
47 | {
48 | return item.pop
49 | ? item
50 | : item.split(/\s+/)
51 | ;
52 | }
53 |
54 | // create table of aliases and script urls
55 | for (i = 0; i < list.length; i++)
56 | {
57 | var aliases = getAliases(list[i]),
58 | url = aliases.pop()
59 | ;
60 |
61 | addBrush(aliases, url);
62 | }
63 |
64 | // dynamically add tags to the document body
65 | for (i = 0; i < elements.length; i++)
66 | {
67 | var url = brushes[elements[i].params.brush];
68 |
69 | if(url && scripts[url] === undefined)
70 | {
71 | if(elements[i].params['html-script'] === 'true')
72 | {
73 | if(scripts[brushes['xml']] === undefined) {
74 | loadScript(brushes['xml']);
75 | scripts[url] = false;
76 | }
77 | }
78 |
79 | scripts[url] = false;
80 | loadScript(url);
81 | }
82 | }
83 |
84 | function loadScript(url)
85 | {
86 | var script = document.createElement('script'),
87 | done = false
88 | ;
89 |
90 | script.src = url;
91 | script.type = 'text/javascript';
92 | script.language = 'javascript';
93 | script.onload = script.onreadystatechange = function()
94 | {
95 | if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
96 | {
97 | done = true;
98 | scripts[url] = true;
99 | checkAll();
100 |
101 | // Handle memory leak in IE
102 | script.onload = script.onreadystatechange = null;
103 | script.parentNode.removeChild(script);
104 | }
105 | };
106 |
107 | // sync way of adding script tags to the page
108 | document.body.appendChild(script);
109 | };
110 |
111 | function checkAll()
112 | {
113 | for(var url in scripts)
114 | if (scripts[url] == false)
115 | return;
116 |
117 | if (allCalled)
118 | SyntaxHighlighter.highlight(allParams);
119 | };
120 | };
121 |
122 | })();
123 |
--------------------------------------------------------------------------------
/PHPMailer/examples/scripts/shLegacy.js:
--------------------------------------------------------------------------------
1 | var dp = {
2 | SyntaxHighlighter : {}
3 | };
4 |
5 | dp.SyntaxHighlighter = {
6 | parseParams: function(
7 | input,
8 | showGutter,
9 | showControls,
10 | collapseAll,
11 | firstLine,
12 | showColumns
13 | )
14 | {
15 | function getValue(list, name)
16 | {
17 | var regex = new XRegExp('^' + name + '\\[(?\\w+)\\]$', 'gi'),
18 | match = null
19 | ;
20 |
21 | for (var i = 0; i < list.length; i++)
22 | if ((match = regex.exec(list[i])) != null)
23 | return match.value;
24 |
25 | return null;
26 | };
27 |
28 | function defaultValue(value, def)
29 | {
30 | return value != null ? value : def;
31 | };
32 |
33 | function asString(value)
34 | {
35 | return value != null ? value.toString() : null;
36 | };
37 |
38 | var parts = input.split(':'),
39 | brushName = parts[0],
40 | options = {},
41 | straight = { 'true' : true }
42 | reverse = { 'true' : false },
43 | result = null,
44 | defaults = SyntaxHighlighter.defaults
45 | ;
46 |
47 | for (var i in parts)
48 | options[parts[i]] = 'true';
49 |
50 | showGutter = asString(defaultValue(showGutter, defaults.gutter));
51 | showControls = asString(defaultValue(showControls, defaults.toolbar));
52 | collapseAll = asString(defaultValue(collapseAll, defaults.collapse));
53 | showColumns = asString(defaultValue(showColumns, defaults.ruler));
54 | firstLine = asString(defaultValue(firstLine, defaults['first-line']));
55 |
56 | return {
57 | brush : brushName,
58 | gutter : defaultValue(reverse[options.nogutter], showGutter),
59 | toolbar : defaultValue(reverse[options.nocontrols], showControls),
60 | collapse : defaultValue(straight[options.collapse], collapseAll),
61 | // ruler : defaultValue(straight[options.showcolumns], showColumns),
62 | 'first-line' : defaultValue(getValue(parts, 'firstline'), firstLine)
63 | };
64 | },
65 |
66 | HighlightAll: function(
67 | name,
68 | showGutter /* optional */,
69 | showControls /* optional */,
70 | collapseAll /* optional */,
71 | firstLine /* optional */,
72 | showColumns /* optional */
73 | )
74 | {
75 | function findValue()
76 | {
77 | var a = arguments;
78 |
79 | for (var i = 0; i < a.length; i++)
80 | {
81 | if (a[i] === null)
82 | continue;
83 |
84 | if (typeof(a[i]) == 'string' && a[i] != '')
85 | return a[i] + '';
86 |
87 | if (typeof(a[i]) == 'object' && a[i].value != '')
88 | return a[i].value + '';
89 | }
90 |
91 | return null;
92 | };
93 |
94 | function findTagsByName(list, name, tagName)
95 | {
96 | var tags = document.getElementsByTagName(tagName);
97 |
98 | for (var i = 0; i < tags.length; i++)
99 | if (tags[i].getAttribute('name') == name)
100 | list.push(tags[i]);
101 | }
102 |
103 | var elements = [],
104 | highlighter = null,
105 | registered = {},
106 | propertyName = 'innerHTML'
107 | ;
108 |
109 | // for some reason IE doesn't find by name, however it does see them just fine by tag name...
110 | findTagsByName(elements, name, 'pre');
111 | findTagsByName(elements, name, 'textarea');
112 |
113 | if (elements.length === 0)
114 | return;
115 |
116 | for (var i = 0; i < elements.length; i++)
117 | {
118 | var element = elements[i],
119 | params = findValue(
120 | element.attributes['class'], element.className,
121 | element.attributes['language'], element.language
122 | ),
123 | language = ''
124 | ;
125 |
126 | if (params === null)
127 | continue;
128 |
129 | params = dp.SyntaxHighlighter.parseParams(
130 | params,
131 | showGutter,
132 | showControls,
133 | collapseAll,
134 | firstLine,
135 | showColumns
136 | );
137 |
138 | SyntaxHighlighter.highlight(params, element);
139 | }
140 | }
141 | };
142 |
--------------------------------------------------------------------------------
/PHPMailer/examples/sendmail.phps:
--------------------------------------------------------------------------------
1 | isSendmail();
12 | //Set who the message is to be sent from
13 | $mail->setFrom('from@example.com', 'First Last');
14 | //Set an alternative reply-to address
15 | $mail->addReplyTo('replyto@example.com', 'First Last');
16 | //Set who the message is to be sent to
17 | $mail->addAddress('whoto@example.com', 'John Doe');
18 | //Set the subject line
19 | $mail->Subject = 'PHPMailer sendmail test';
20 | //Read an HTML message body from an external file, convert referenced images to embedded,
21 | //convert HTML into a basic plain-text alternative body
22 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
23 | //Replace the plain text body with one created manually
24 | $mail->AltBody = 'This is a plain-text message body';
25 | //Attach an image file
26 | $mail->addAttachment('images/phpmailer_mini.png');
27 |
28 | //send the message, check for errors
29 | if (!$mail->send()) {
30 | echo "Mailer Error: " . $mail->ErrorInfo;
31 | } else {
32 | echo "Message sent!";
33 | }
34 |
--------------------------------------------------------------------------------
/PHPMailer/examples/smtp.phps:
--------------------------------------------------------------------------------
1 | isSMTP();
16 | //Enable SMTP debugging
17 | // 0 = off (for production use)
18 | // 1 = client messages
19 | // 2 = client and server messages
20 | $mail->SMTPDebug = 2;
21 | //Ask for HTML-friendly debug output
22 | $mail->Debugoutput = 'html';
23 | //Set the hostname of the mail server
24 | $mail->Host = "mail.example.com";
25 | //Set the SMTP port number - likely to be 25, 465 or 587
26 | $mail->Port = 25;
27 | //Whether to use SMTP authentication
28 | $mail->SMTPAuth = true;
29 | //Username to use for SMTP authentication
30 | $mail->Username = "yourname@example.com";
31 | //Password to use for SMTP authentication
32 | $mail->Password = "yourpassword";
33 | //Set who the message is to be sent from
34 | $mail->setFrom('from@example.com', 'First Last');
35 | //Set an alternative reply-to address
36 | $mail->addReplyTo('replyto@example.com', 'First Last');
37 | //Set who the message is to be sent to
38 | $mail->addAddress('whoto@example.com', 'John Doe');
39 | //Set the subject line
40 | $mail->Subject = 'PHPMailer SMTP test';
41 | //Read an HTML message body from an external file, convert referenced images to embedded,
42 | //convert HTML into a basic plain-text alternative body
43 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
44 | //Replace the plain text body with one created manually
45 | $mail->AltBody = 'This is a plain-text message body';
46 | //Attach an image file
47 | $mail->addAttachment('images/phpmailer_mini.png');
48 |
49 | //send the message, check for errors
50 | if (!$mail->send()) {
51 | echo "Mailer Error: " . $mail->ErrorInfo;
52 | } else {
53 | echo "Message sent!";
54 | }
55 |
--------------------------------------------------------------------------------
/PHPMailer/examples/smtp_check.phps:
--------------------------------------------------------------------------------
1 | do_debug = SMTP::DEBUG_CONNECTION;
18 |
19 | try {
20 | //Connect to an SMTP server
21 | if ($smtp->connect('mail.example.com', 25)) {
22 | //Say hello
23 | if ($smtp->hello('localhost')) { //Put your host name in here
24 | //Authenticate
25 | if ($smtp->authenticate('username', 'password')) {
26 | echo "Connected ok!";
27 | } else {
28 | throw new Exception('Authentication failed: ' . $smtp->getLastReply());
29 | }
30 | } else {
31 | throw new Exception('HELO failed: '. $smtp->getLastReply());
32 | }
33 | } else {
34 | throw new Exception('Connect failed');
35 | }
36 | } catch (Exception $e) {
37 | echo 'SMTP error: '. $e->getMessage(), "\n";
38 | }
39 | //Whatever happened, close the connection.
40 | $smtp->quit(true);
41 |
--------------------------------------------------------------------------------
/PHPMailer/examples/smtp_no_auth.phps:
--------------------------------------------------------------------------------
1 | isSMTP();
16 | //Enable SMTP debugging
17 | // 0 = off (for production use)
18 | // 1 = client messages
19 | // 2 = client and server messages
20 | $mail->SMTPDebug = 2;
21 | //Ask for HTML-friendly debug output
22 | $mail->Debugoutput = 'html';
23 | //Set the hostname of the mail server
24 | $mail->Host = "mail.example.com";
25 | //Set the SMTP port number - likely to be 25, 465 or 587
26 | $mail->Port = 25;
27 | //Whether to use SMTP authentication
28 | $mail->SMTPAuth = false;
29 | //Set who the message is to be sent from
30 | $mail->setFrom('from@example.com', 'First Last');
31 | //Set an alternative reply-to address
32 | $mail->addReplyTo('replyto@example.com', 'First Last');
33 | //Set who the message is to be sent to
34 | $mail->addAddress('whoto@example.com', 'John Doe');
35 | //Set the subject line
36 | $mail->Subject = 'PHPMailer SMTP without auth test';
37 | //Read an HTML message body from an external file, convert referenced images to embedded,
38 | //convert HTML into a basic plain-text alternative body
39 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
40 | //Replace the plain text body with one created manually
41 | $mail->AltBody = 'This is a plain-text message body';
42 | //Attach an image file
43 | $mail->addAttachment('images/phpmailer_mini.png');
44 |
45 | //send the message, check for errors
46 | if (!$mail->send()) {
47 | echo "Mailer Error: " . $mail->ErrorInfo;
48 | } else {
49 | echo "Message sent!";
50 | }
51 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeAppleScript.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter.applescript{background:white;font-size:1em;color:black;}
2 | .syntaxhighlighter.applescript div,.syntaxhighlighter.applescript code{font:1em/1.25 Verdana,sans-serif !important;}
3 | .syntaxhighlighter.applescript .code .line{overflow:hidden !important;}
4 | .syntaxhighlighter.applescript .code .line.highlighted{background:#b5d5ff !important;}
5 | .syntaxhighlighter.applescript .color1{color:#000000 !important;}
6 | .syntaxhighlighter.applescript .color2{color:#000000 !important;}
7 | .syntaxhighlighter.applescript .color3{color:#000000 !important;font-weight:bold !important;}
8 | .syntaxhighlighter.applescript .keyword{color:#000000 !important;font-weight:bold !important;}
9 | .syntaxhighlighter.applescript .color4{color:#0000ff !important;font-style:italic !important;}
10 | .syntaxhighlighter.applescript .comments{color:#4c4d4d !important;}
11 | .syntaxhighlighter.applescript .plain{color:#408000 !important;}
12 | .syntaxhighlighter.applescript .string{color:#000000 !important;}
13 | .syntaxhighlighter.applescript .commandNames{color:#0000ff !important;font-weight:bold !important;}
14 | .syntaxhighlighter.applescript .parameterNames{color:#0000ff !important;}
15 | .syntaxhighlighter.applescript .classes{color:#0000ff !important;font-style:italic !important;}
16 | .syntaxhighlighter.applescript .properties{color:#6c04d4 !important;}
17 | .syntaxhighlighter.applescript .enumeratedValues{color:#4a1e7f !important;}
18 | .syntaxhighlighter.applescript .additionCommandNames{color:#0016b0 !important;font-weight:bold !important;}
19 | .syntaxhighlighter.applescript .additionParameterNames{color:#0016b0 !important;}
20 | .syntaxhighlighter.applescript .additionClasses{color:#0016b0 !important;font-style:italic !important;}
21 | .syntaxhighlighter.applescript .spaces{display:inline-block;height:0 !important;font-size:1.75em !important;line-height:0 !important;}
22 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeDefault.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:white !important;}
2 | .syntaxhighlighter .line.alt1{background-color:white !important;}
3 | .syntaxhighlighter .line.alt2{background-color:white !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#e0e0e0 !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:black !important;}
6 | .syntaxhighlighter table caption{color:black !important;}
7 | .syntaxhighlighter .gutter{color:#afafaf !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #6ce26c !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#6ce26c !important;color:white !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:blue !important;background:white !important;border:1px solid #6ce26c !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:blue !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:red !important;}
15 | .syntaxhighlighter .toolbar{color:white !important;background:#6ce26c !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:white !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:black !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:black !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#008200 !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:blue !important;}
21 | .syntaxhighlighter .keyword{color:#006699 !important;}
22 | .syntaxhighlighter .preprocessor{color:gray !important;}
23 | .syntaxhighlighter .variable{color:#aa7700 !important;}
24 | .syntaxhighlighter .value{color:#009900 !important;}
25 | .syntaxhighlighter .functions{color:#ff1493 !important;}
26 | .syntaxhighlighter .constants{color:#0066cc !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:#006699 !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:gray !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff1493 !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:red !important;}
31 | .syntaxhighlighter .keyword{font-weight:bold !important;}
32 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeDjango.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:#0a2b1d !important;}
2 | .syntaxhighlighter .line.alt1{background-color:#0a2b1d !important;}
3 | .syntaxhighlighter .line.alt2{background-color:#0a2b1d !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#233729 !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:white !important;}
6 | .syntaxhighlighter table caption{color:#f8f8f8 !important;}
7 | .syntaxhighlighter .gutter{color:#497958 !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #41a83e !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#41a83e !important;color:#0a2b1d !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:#96dd3b !important;background:black !important;border:1px solid #41a83e !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:#96dd3b !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:white !important;}
15 | .syntaxhighlighter .toolbar{color:white !important;background:#41a83e !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:white !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:#ffe862 !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#f8f8f8 !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#336442 !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:#9df39f !important;}
21 | .syntaxhighlighter .keyword{color:#96dd3b !important;}
22 | .syntaxhighlighter .preprocessor{color:#91bb9e !important;}
23 | .syntaxhighlighter .variable{color:#ffaa3e !important;}
24 | .syntaxhighlighter .value{color:#f7e741 !important;}
25 | .syntaxhighlighter .functions{color:#ffaa3e !important;}
26 | .syntaxhighlighter .constants{color:#e0e8ff !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:#96dd3b !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#eb939a !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#91bb9e !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#edef7d !important;}
31 | .syntaxhighlighter .comments{font-style:italic !important;}
32 | .syntaxhighlighter .keyword{font-weight:bold !important;}
33 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeEclipse.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:white !important;}
2 | .syntaxhighlighter .line.alt1{background-color:white !important;}
3 | .syntaxhighlighter .line.alt2{background-color:white !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#c3defe !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:white !important;}
6 | .syntaxhighlighter table caption{color:black !important;}
7 | .syntaxhighlighter .gutter{color:#787878 !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #d4d0c8 !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#d4d0c8 !important;color:white !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:#3f5fbf !important;background:white !important;border:1px solid #d4d0c8 !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:#3f5fbf !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:#aa7700 !important;}
15 | .syntaxhighlighter .toolbar{color:#a0a0a0 !important;background:#d4d0c8 !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:#a0a0a0 !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:red !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:black !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#3f5fbf !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:#2a00ff !important;}
21 | .syntaxhighlighter .keyword{color:#7f0055 !important;}
22 | .syntaxhighlighter .preprocessor{color:#646464 !important;}
23 | .syntaxhighlighter .variable{color:#aa7700 !important;}
24 | .syntaxhighlighter .value{color:#009900 !important;}
25 | .syntaxhighlighter .functions{color:#ff1493 !important;}
26 | .syntaxhighlighter .constants{color:#0066cc !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:#7f0055 !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:gray !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff1493 !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:red !important;}
31 | .syntaxhighlighter .keyword{font-weight:bold !important;}
32 | .syntaxhighlighter .xml .keyword{color:#3f7f7f !important;font-weight:normal !important;}
33 | .syntaxhighlighter .xml .color1,.syntaxhighlighter .xml .color1 a{color:#7f007f !important;}
34 | .syntaxhighlighter .xml .string{font-style:italic !important;color:#2a00ff !important;}
35 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeEmacs.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:black !important;}
2 | .syntaxhighlighter .line.alt1{background-color:black !important;}
3 | .syntaxhighlighter .line.alt2{background-color:black !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#2a3133 !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:white !important;}
6 | .syntaxhighlighter table caption{color:#d3d3d3 !important;}
7 | .syntaxhighlighter .gutter{color:#d3d3d3 !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #990000 !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#990000 !important;color:black !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:#ebdb8d !important;background:black !important;border:1px solid #990000 !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:#ebdb8d !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:#ff7d27 !important;}
15 | .syntaxhighlighter .toolbar{color:white !important;background:#990000 !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:white !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:#9ccff4 !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#d3d3d3 !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#ff7d27 !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:#ff9e7b !important;}
21 | .syntaxhighlighter .keyword{color:aqua !important;}
22 | .syntaxhighlighter .preprocessor{color:#aec4de !important;}
23 | .syntaxhighlighter .variable{color:#ffaa3e !important;}
24 | .syntaxhighlighter .value{color:#009900 !important;}
25 | .syntaxhighlighter .functions{color:#81cef9 !important;}
26 | .syntaxhighlighter .constants{color:#ff9e7b !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:aqua !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#ebdb8d !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff7d27 !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#aec4de !important;}
31 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeFadeToGrey.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:#121212 !important;}
2 | .syntaxhighlighter .line.alt1{background-color:#121212 !important;}
3 | .syntaxhighlighter .line.alt2{background-color:#121212 !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#2c2c29 !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:white !important;}
6 | .syntaxhighlighter table caption{color:white !important;}
7 | .syntaxhighlighter .gutter{color:#afafaf !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #3185b9 !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#3185b9 !important;color:#121212 !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:#3185b9 !important;background:black !important;border:1px solid #3185b9 !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:#3185b9 !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:#d01d33 !important;}
15 | .syntaxhighlighter .toolbar{color:white !important;background:#3185b9 !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:white !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:#96daff !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:white !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#696854 !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:#e3e658 !important;}
21 | .syntaxhighlighter .keyword{color:#d01d33 !important;}
22 | .syntaxhighlighter .preprocessor{color:#435a5f !important;}
23 | .syntaxhighlighter .variable{color:#898989 !important;}
24 | .syntaxhighlighter .value{color:#009900 !important;}
25 | .syntaxhighlighter .functions{color:#aaaaaa !important;}
26 | .syntaxhighlighter .constants{color:#96daff !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:#d01d33 !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#ffc074 !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#4a8cdb !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#96daff !important;}
31 | .syntaxhighlighter .functions{font-weight:bold !important;}
32 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeMDUltra.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:#222222 !important;}
2 | .syntaxhighlighter .line.alt1{background-color:#222222 !important;}
3 | .syntaxhighlighter .line.alt2{background-color:#222222 !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#253e5a !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:white !important;}
6 | .syntaxhighlighter table caption{color:lime !important;}
7 | .syntaxhighlighter .gutter{color:#38566f !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#222222 !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:#428bdd !important;background:black !important;border:1px solid #435a5f !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:#428bdd !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:lime !important;}
15 | .syntaxhighlighter .toolbar{color:#aaaaff !important;background:#435a5f !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:#aaaaff !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:#9ccff4 !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:lime !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#428bdd !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:lime !important;}
21 | .syntaxhighlighter .keyword{color:#aaaaff !important;}
22 | .syntaxhighlighter .preprocessor{color:#8aa6c1 !important;}
23 | .syntaxhighlighter .variable{color:aqua !important;}
24 | .syntaxhighlighter .value{color:#f7e741 !important;}
25 | .syntaxhighlighter .functions{color:#ff8000 !important;}
26 | .syntaxhighlighter .constants{color:yellow !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:#aaaaff !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:red !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:yellow !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}
31 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeMidnight.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:#0f192a !important;}
2 | .syntaxhighlighter .line.alt1{background-color:#0f192a !important;}
3 | .syntaxhighlighter .line.alt2{background-color:#0f192a !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#253e5a !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:#38566f !important;}
6 | .syntaxhighlighter table caption{color:#d1edff !important;}
7 | .syntaxhighlighter .gutter{color:#afafaf !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#0f192a !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:#428bdd !important;background:black !important;border:1px solid #435a5f !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:#428bdd !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:#1dc116 !important;}
15 | .syntaxhighlighter .toolbar{color:#d1edff !important;background:#435a5f !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:#d1edff !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:#8aa6c1 !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#d1edff !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#428bdd !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:#1dc116 !important;}
21 | .syntaxhighlighter .keyword{color:#b43d3d !important;}
22 | .syntaxhighlighter .preprocessor{color:#8aa6c1 !important;}
23 | .syntaxhighlighter .variable{color:#ffaa3e !important;}
24 | .syntaxhighlighter .value{color:#f7e741 !important;}
25 | .syntaxhighlighter .functions{color:#ffaa3e !important;}
26 | .syntaxhighlighter .constants{color:#e0e8ff !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:#b43d3d !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#f8bb00 !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:white !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}
31 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeRDark.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:#1b2426 !important;}
2 | .syntaxhighlighter .line.alt1{background-color:#1b2426 !important;}
3 | .syntaxhighlighter .line.alt2{background-color:#1b2426 !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#323e41 !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:#b9bdb6 !important;}
6 | .syntaxhighlighter table caption{color:#b9bdb6 !important;}
7 | .syntaxhighlighter .gutter{color:#afafaf !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #435a5f !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#435a5f !important;color:#1b2426 !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:#5ba1cf !important;background:black !important;border:1px solid #435a5f !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:#5ba1cf !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:#5ce638 !important;}
15 | .syntaxhighlighter .toolbar{color:white !important;background:#435a5f !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:white !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:#e0e8ff !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:#b9bdb6 !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#878a85 !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:#5ce638 !important;}
21 | .syntaxhighlighter .keyword{color:#5ba1cf !important;}
22 | .syntaxhighlighter .preprocessor{color:#435a5f !important;}
23 | .syntaxhighlighter .variable{color:#ffaa3e !important;}
24 | .syntaxhighlighter .value{color:#009900 !important;}
25 | .syntaxhighlighter .functions{color:#ffaa3e !important;}
26 | .syntaxhighlighter .constants{color:#e0e8ff !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:#5ba1cf !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:#e0e8ff !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:white !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:#ffaa3e !important;}
31 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/shThemeVisualStudio.css:
--------------------------------------------------------------------------------
1 | .syntaxhighlighter{background-color:white !important;}
2 | .syntaxhighlighter .line.alt1{background-color:white !important;}
3 | .syntaxhighlighter .line.alt2{background-color:white !important;}
4 | .syntaxhighlighter .line.highlighted.alt1,.syntaxhighlighter .line.highlighted.alt2{background-color:#e0e0e0 !important;}
5 | .syntaxhighlighter .line.highlighted.number{color:black !important;}
6 | .syntaxhighlighter table caption{color:black !important;}
7 | .syntaxhighlighter .gutter{color:#afafaf !important;}
8 | .syntaxhighlighter .gutter .line{border-right:3px solid #6ce26c !important;}
9 | .syntaxhighlighter .gutter .line.highlighted{background-color:#6ce26c !important;color:white !important;}
10 | .syntaxhighlighter.printing .line .content{border:none !important;}
11 | .syntaxhighlighter.collapsed{overflow:visible !important;}
12 | .syntaxhighlighter.collapsed .toolbar{color:blue !important;background:white !important;border:1px solid #6ce26c !important;}
13 | .syntaxhighlighter.collapsed .toolbar a{color:blue !important;}
14 | .syntaxhighlighter.collapsed .toolbar a:hover{color:red !important;}
15 | .syntaxhighlighter .toolbar{color:white !important;background:#6ce26c !important;border:none !important;}
16 | .syntaxhighlighter .toolbar a{color:white !important;}
17 | .syntaxhighlighter .toolbar a:hover{color:black !important;}
18 | .syntaxhighlighter .plain,.syntaxhighlighter .plain a{color:black !important;}
19 | .syntaxhighlighter .comments,.syntaxhighlighter .comments a{color:#008200 !important;}
20 | .syntaxhighlighter .string,.syntaxhighlighter .string a{color:#d11010 !important;}
21 | .syntaxhighlighter .keyword{color:#006699 !important;}
22 | .syntaxhighlighter .preprocessor{color:gray !important;}
23 | .syntaxhighlighter .variable{color:#aa7700 !important;}
24 | .syntaxhighlighter .value{color:#009900 !important;}
25 | .syntaxhighlighter .functions{color:#ff1493 !important;}
26 | .syntaxhighlighter .constants{color:#0066cc !important;}
27 | .syntaxhighlighter .script{font-weight:bold !important;color:#006699 !important;background-color:none !important;}
28 | .syntaxhighlighter .color1,.syntaxhighlighter .color1 a{color:gray !important;}
29 | .syntaxhighlighter .color2,.syntaxhighlighter .color2 a{color:#ff1493 !important;}
30 | .syntaxhighlighter .color3,.syntaxhighlighter .color3 a{color:red !important;}
31 | .syntaxhighlighter .keyword{font-weight:bold !important;}
32 |
--------------------------------------------------------------------------------
/PHPMailer/examples/styles/wrapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudXNS/mss/3c7af06ef22f49b78f7f18a3ac69ef785ad7591f/PHPMailer/examples/styles/wrapping.png
--------------------------------------------------------------------------------
/PHPMailer/extras/EasyPeasyICS.php:
--------------------------------------------------------------------------------
1 | calendarName = $calendarName;
29 | }//function
30 |
31 |
32 | /**
33 | * Add event to calendar
34 | * @param string $calendarName
35 | */
36 | public function addEvent($start, $end, $summary="", $description="", $url=""){
37 | $this->events[] = array(
38 | "start" => $start,
39 | "end" => $end,
40 | "summary" => $summary,
41 | "description" => $description,
42 | "url" => $url
43 | );
44 | }//function
45 |
46 |
47 | public function render($output = true){
48 |
49 | //start Variable
50 | $ics = "";
51 |
52 | //Add header
53 | $ics .= "BEGIN:VCALENDAR
54 | METHOD:PUBLISH
55 | VERSION:2.0
56 | X-WR-CALNAME:".$this->calendarName."
57 | PRODID:-//hacksw/handcal//NONSGML v1.0//EN";
58 |
59 | //Add events
60 | foreach($this->events as $event){
61 | $ics .= "
62 | BEGIN:VEVENT
63 | UID:". md5(uniqid(mt_rand(), true)) ."@EasyPeasyICS.php
64 | DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z
65 | DTSTART:".gmdate('Ymd', $event["start"])."T".gmdate('His', $event["start"])."Z
66 | DTEND:".gmdate('Ymd', $event["end"])."T".gmdate('His', $event["end"])."Z
67 | SUMMARY:".str_replace("\n", "\\n", $event['summary'])."
68 | DESCRIPTION:".str_replace("\n", "\\n", $event['description'])."
69 | URL;VALUE=URI:".$event['url']."
70 | END:VEVENT";
71 | }//foreach
72 |
73 |
74 | //Footer
75 | $ics .= "
76 | END:VCALENDAR";
77 |
78 |
79 | if ($output) {
80 | //Output
81 | header('Content-type: text/calendar; charset=utf-8');
82 | header('Content-Disposition: inline; filename='.$this->calendarName.'.ics');
83 | echo $ics;
84 | } else {
85 | return $ics;
86 | }
87 |
88 | }//function
89 |
90 | }//class
--------------------------------------------------------------------------------
/PHPMailer/extras/README.md:
--------------------------------------------------------------------------------
1 | #PHPMailer Extras
2 |
3 | These classes provide optional additional functions to PHPMailer.
4 |
5 | These are not loaded by the PHPMailer autoloader, so in some cases you may need to `require` them yourself before using them.
6 |
7 | ##HTML2Text
8 |
9 | This class was written by Jon Abernathy and provides a simple conversion of HTML to plain-text, while attempting to preserve some aspects of the formatting. It is used in PHPMailer if you set the `advanced` parameter to `true` in either the `msgHTML()` or `html2text` methods of PHPMailer.
10 |
11 | ##EasyPeasyICS
12 |
13 | This class was originally written by Manuel Reinhard and provides a simple means of generating ICS/vCal files that are used in sending calendar events. PHPMailer does not use it directly, but you can use it to generate content appropriate for placing in the `Ical` property of PHPMailer. The PHPMailer project is now its official home as Manuel has given permission for that and is no longer maintaining it himself.
14 |
15 | ##htmlfilter
16 |
17 | This class by Konstantin Riabitsev and Jim Jagielski implements HTML filtering to remove potentially malicious tags, such as `