Index: trunk/extensions/EmailPage/EmailPage_body.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php |
3 | | -if ( !defined( 'MEDIAWIKI' ) ) die(); |
| 3 | +if( !defined( 'MEDIAWIKI' ) ) die(); |
4 | 4 | |
5 | 5 | class SpecialEmailPage extends SpecialPage { |
6 | 6 | |
— | — | @@ -7,7 +7,6 @@ |
8 | 8 | var $title; |
9 | 9 | var $subject; |
10 | 10 | var $header; |
11 | | - var $cat; |
12 | 11 | var $group; |
13 | 12 | var $list; |
14 | 13 | var $textonly; |
— | — | @@ -38,21 +37,19 @@ |
39 | 38 | $this->title = $wgRequest->getText( 'ea-title', $param ); |
40 | 39 | $this->subject = $wgRequest->getText( 'ea-subject', wfMsg( 'ea-pagesend', $this->title, $wgSitename ) ); |
41 | 40 | $this->header = $wgRequest->getText( 'ea-header' ); |
42 | | - $this->cat = $wgRequest->getText( 'ea-cat' ); |
43 | 41 | $this->group = $wgRequest->getText( 'ea-group' ); |
44 | 42 | $this->list = $wgRequest->getText( 'ea-list' ); |
45 | 43 | $this->textonly = $wgRequest->getText( 'ea-textonly', false ); |
46 | 44 | $this->css = $wgRequest->getText( 'ea-css', $wgEmailPageCss ); |
47 | 45 | $this->record = $wgRequest->getText( 'ea-record', false ); |
48 | | - $this->db = $db; |
49 | | - $this->parser = $wgParser; |
| 46 | + $this->db = $db; |
50 | 47 | |
51 | 48 | # Bail if no page title to send has been specified |
52 | | - if ( $this->title ) $wgOut->addWikiText( wfMsg( 'ea-heading', $this->title ) ); |
| 49 | + if( $this->title ) $wgOut->addWikiText( wfMsg( 'ea-heading', $this->title ) ); |
53 | 50 | else return $wgOut->addWikiText( wfMsg( 'ea-nopage' ) ); |
54 | 51 | |
55 | 52 | # If the send button was clicked, attempt to send and exit |
56 | | - if ( isset( $_REQUEST['ea-send'] ) ) return $this->send(); |
| 53 | + if( isset( $_REQUEST['ea-send'] ) ) return $this->send(); |
57 | 54 | |
58 | 55 | # Render form |
59 | 56 | $special = SpecialPage::getTitleFor( 'EmailPage' ); |
— | — | @@ -64,35 +61,13 @@ |
65 | 62 | $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'ea-selectrecipients' ) . '</legend>' ); |
66 | 63 | $wgOut->addHTML( '<table style="padding:0;margin:0;border:none;">' ); |
67 | 64 | |
68 | | - # If $wgEmailPageContactsCat is set, create a select list of all categories |
69 | | - if ( $wgEmailPageContactsCat ) { |
70 | | - $cats = ''; |
71 | | - $res = $db->select( |
72 | | - 'categorylinks', |
73 | | - 'cl_from', |
74 | | - 'cl_to = ' . $db->addQuotes( $wgEmailPageContactsCat ), |
75 | | - __METHOD__, |
76 | | - array( 'ORDER BY' => 'cl_sortkey' ) |
77 | | - ); |
78 | | - while ( $row = $db->fetchRow( $res ) ) { |
79 | | - $t = Title::newFromID( $row[0] ); |
80 | | - if ( $t->getNamespace() == NS_CATEGORY ) { |
81 | | - $cat = $t->getText(); |
82 | | - $selected = $cat == $this->cat ? ' selected' : ''; |
83 | | - $cats .= "<option$selected>$cat</option>"; |
84 | | - } |
85 | | - } |
86 | | - $db->freeResult( $res ); |
87 | | - if ( $cats ) $wgOut->addHTML( "<tr><td>From category:</td><td><select name=\"ea-cat\"><option/>$cats</select></td></tr>\n" ); |
88 | | - } |
89 | | - |
90 | 65 | # Allow selection of a group |
91 | 66 | $groups = "<option />"; |
92 | | - foreach ( array_keys( $wgGroupPermissions ) as $group ) if ( $group != '*' && $group != 'user' ) { |
| 67 | + foreach( array_keys( $wgGroupPermissions ) as $group ) if( $group != '*' && $group != 'user' ) { |
93 | 68 | $selected = $group == $this->group ? ' selected' : ''; |
94 | 69 | $groups .= "<option$selected>$group</option>"; |
95 | 70 | } |
96 | | - if ( $wgEmailPageAllowAllUsers ) { |
| 71 | + if( $wgEmailPageAllowAllUsers ) { |
97 | 72 | $selected = 'user' == $this->group ? ' selected' : ''; |
98 | 73 | $groups .= "<option$selected value='user'>ALL USERS</option>"; |
99 | 74 | } |
— | — | @@ -125,20 +100,20 @@ |
126 | 101 | __METHOD__, |
127 | 102 | array( 'ORDER BY' => 'page_title' ) |
128 | 103 | ); |
129 | | - while ( $row = $db->fetchRow( $res ) ) { |
| 104 | + while( $row = $db->fetchRow( $res ) ) { |
130 | 105 | $t = Title::newFromID( $row[0] )->getPrefixedText(); |
131 | 106 | $selected = $t == $this->css ? ' selected' : ''; |
132 | 107 | $options .= "<option$selected>$t</option>"; |
133 | 108 | } |
134 | 109 | $db->freeResult( $res ); |
135 | | - if ( $options ) $wgOut->addHTML( wfMsg( 'ea-selectcss' ) . " <select name=\"ea-css\">$options</select><br />\n" ); |
| 110 | + if( $options ) $wgOut->addHTML( wfMsg( 'ea-selectcss' ) . " <select name=\"ea-css\">$options</select><br />\n" ); |
136 | 111 | |
137 | 112 | # Get titles in Category:Records and build option list |
138 | 113 | $options = "<option />"; |
139 | 114 | $cl = $db->tableName( 'categorylinks' ); |
140 | 115 | $cat = $db->addQuotes( $wgRecordAdminCategory ? $wgRecordAdminCategory : 'Records' ); |
141 | 116 | $res = $db->select( $cl, 'cl_from', "cl_to = $cat", __METHOD__, array( 'ORDER BY' => 'cl_sortkey' ) ); |
142 | | - while ( $row = $db->fetchRow( $res ) ) { |
| 117 | + while( $row = $db->fetchRow( $res ) ) { |
143 | 118 | $t = Title::newFromID( $row[0] )->getText(); |
144 | 119 | $selected = $t == $this->record ? ' selected' : ''; |
145 | 120 | $options .= "<option$selected>$t</option>"; |
— | — | @@ -155,7 +130,7 @@ |
156 | 131 | $wgOut->addHTML( "</form>" ); |
157 | 132 | |
158 | 133 | # If the show button was clicked, render the list |
159 | | - if ( isset( $_REQUEST['ea-show'] ) ) return $this->send( false ); |
| 134 | + if( isset( $_REQUEST['ea-show'] ) ) return $this->send( false ); |
160 | 135 | } |
161 | 136 | |
162 | 137 | /** |
— | — | @@ -166,51 +141,36 @@ |
167 | 142 | $wgEmailPageCss, $wgEmailPageGroup, $wgEmailPageAllowRemoteAddr, $wgEmailPageAllowAllUsers; |
168 | 143 | |
169 | 144 | # Set error and bail if user not in postmaster group, and request not from trusted address |
170 | | - if ( $wgEmailPageGroup && !in_array( $wgEmailPageGroup, $wgUser->getGroups() ) |
| 145 | + if( $wgEmailPageGroup && !in_array( $wgEmailPageGroup, $wgUser->getGroups() ) |
171 | 146 | && !in_array( $_SERVER['REMOTE_ADDR'], $wgEmailPageAllowRemoteAddr ) ) { |
172 | 147 | $denied = wfMsg( 'ea-denied' ); |
173 | 148 | $wgOut->addWikiText( wfMsg( 'ea-error', $this->title, $denied ) ); |
174 | 149 | return false; |
175 | 150 | } |
176 | 151 | |
177 | | - $db = wfGetDB( DB_SLAVE ); |
178 | | - $title = Title::newFromText( $this->title ); |
179 | | - $opt = new ParserOptions; |
180 | | - |
181 | | - # Get contact page titles from selected cat |
182 | | - if ( $this->cat ) { |
183 | | - $res = $db->select( |
184 | | - 'categorylinks', |
185 | | - 'cl_from', |
186 | | - 'cl_to = ' . $db->addQuotes( $this->cat ), |
187 | | - __METHOD__, |
188 | | - array( 'ORDER BY' => 'cl_sortkey' ) |
189 | | - ); |
190 | | - if ( $res ) while ( $row = $db->fetchRow( $res ) ) $this->addRecipient( Title::newFromID( $row[0] ) ); |
191 | | - $db->freeResult( $res ); |
192 | | - } |
193 | | - |
194 | 152 | # Get email addresses from users in selected group |
195 | | - if ( $this->group && ( $wgEmailPageAllowAllUsers || $this->group != 'user' ) ) { |
| 153 | + $db = $this->db; |
| 154 | + if( $this->group && ( $wgEmailPageAllowAllUsers || $this->group != 'user' ) ) { |
196 | 155 | $group = $db->addQuotes( $this->group ); |
197 | 156 | $res = $this->group == 'user' |
198 | 157 | ? $db->select( 'user', 'user_email', 'user_email != \'\'', __METHOD__ ) |
199 | 158 | : $db->select( array( 'user', 'user_groups' ), 'user_email', "ug_user = user_id AND ug_group = $group", __METHOD__ ); |
200 | | - while ( $row = $db->fetchRow( $res ) ) $this->addRecipient( $row[0] ); |
| 159 | + while( $row = $db->fetchRow( $res ) ) $this->addRecipient( $row[0] ); |
201 | 160 | $db->freeResult( $res ); |
202 | 161 | } |
203 | 162 | |
204 | 163 | # Recipients from list (expand templates in wikitext) |
205 | | - $list = $wgParser->preprocess( $this->list, $title, $opt ); |
206 | | - foreach ( preg_split( "/[\\x00-\\x1f,;*]+/", $list ) as $item ) $this->addRecipient( $item ); |
| 164 | + foreach( preg_split( "/[\\x00-\\x1f,;*]+/", $this->list ) as $item ) $this->addRecipient( $item ); |
207 | 165 | |
208 | 166 | # Compose the wikitext content of the page to send |
209 | | - $page = new Article( $title ); |
| 167 | + $title = Title::newFromText( $this->title ); |
| 168 | + $opt = new ParserOptions; |
| 169 | + $page = new Article( $title ); |
210 | 170 | $message = $page->getContent(); |
211 | | - if ( $this->header ) $message = "{$this->header}\n\n$message"; |
| 171 | + if( $this->header ) $message = "{$this->header}\n\n$message"; |
212 | 172 | |
213 | 173 | # Convert the message text to html unless textonly |
214 | | - if ( $this->textonly == '' ) { |
| 174 | + if( $this->textonly == '' ) { |
215 | 175 | |
216 | 176 | # Parse the wikitext using absolute URL's for local page links |
217 | 177 | $tmp = array( $wgArticlePath, $wgScriptPath, $wgScript ); |
— | — | @@ -221,7 +181,7 @@ |
222 | 182 | list( $wgArticlePath, $wgScriptPath, $wgScript ) = $tmp; |
223 | 183 | |
224 | 184 | # Get CSS content if any |
225 | | - if ( $this->css ) { |
| 185 | + if( $this->css ) { |
226 | 186 | $page = new Article( Title::newFromText( $this->css ) ); |
227 | 187 | $css = "<style type='text/css'>" . $page->getContent() . "</style>"; |
228 | 188 | } else $css = ''; |
— | — | @@ -234,10 +194,10 @@ |
235 | 195 | |
236 | 196 | # Send message or list recipients |
237 | 197 | $count = count( $this->recipients ); |
238 | | - if ( $count > 0 ) { |
| 198 | + if( $count > 0 ) { |
239 | 199 | |
240 | 200 | # Set up new mailer instance if sending |
241 | | - if ( $send ) { |
| 201 | + if( $send ) { |
242 | 202 | $mail = new PHPMailer(); |
243 | 203 | $mail->From = $wgUser->isValidEmailAddr( $wgUser->getEmail() ) ? $wgUser->getEmail() : $wgEmergencyContact; |
244 | 204 | $mail->FromName = User::whoIsReal( $wgUser->getId() ); |
— | — | @@ -248,16 +208,16 @@ |
249 | 209 | else $msg = wfMsg( 'ea-listrecipients', $count ); |
250 | 210 | |
251 | 211 | # Loop through recipients sending or adding to list |
252 | | - foreach ( $this->recipients as $recipient ) { |
| 212 | + foreach( $this->recipients as $recipient ) { |
253 | 213 | $error = ''; |
254 | | - if ( $send ) { |
255 | | - if ( $this->record ) $mail->Body = $this->replaceFields( $message, $recipient ); |
| 214 | + if( $send ) { |
| 215 | + if( $this->record ) $mail->Body = $this->replaceFields( $message, $recipient ); |
256 | 216 | $mail->AddAddress( $recipient ); |
257 | | - if ( $state = $mail->Send() ) $msg = wfMsg( 'ea-sent', $this->title, $count, $wgUser->getName() ); |
| 217 | + if( $state = $mail->Send() ) $msg = wfMsg( 'ea-sent', $this->title, $count, $wgUser->getName() ); |
258 | 218 | else $error .= "Couldn't send to $recipient: {$mail->ErrorInfo}<br />\n"; |
259 | 219 | $mail->ClearAddresses(); |
260 | 220 | } else $msg .= "\n*[mailto:$recipient $recipient]"; |
261 | | - if ( $error ) $msg = wfMsg( 'ea-error', $this->title, $error ); |
| 221 | + if( $error ) $msg = wfMsg( 'ea-error', $this->title, $error ); |
262 | 222 | } |
263 | 223 | } |
264 | 224 | else $msg = wfMsg( 'ea-error', $this->title, wfMsg( 'ea-norecipients' ) ); |
— | — | @@ -268,15 +228,9 @@ |
269 | 229 | |
270 | 230 | /** |
271 | 231 | * Add a recipient the list |
272 | | - * - accepts title objects for page containing email address, or string of actual address |
273 | 232 | */ |
274 | 233 | function addRecipient( $recipient ) { |
275 | | - if ( is_object( $recipient ) && $recipient->exists() ) { |
276 | | - $page = new Article( $recipient ); |
277 | | - if ( preg_match( "|[a-z0-9_.-]+@[a-z0-9_.-]+|i", $page->getContent(), $emails ) ) $recipient = $emails[0]; |
278 | | - else $recipient = ''; |
279 | | - } |
280 | | - if ( $valid = User::isValidEmailAddr( $recipient ) ) $this->recipients[] = $recipient; |
| 234 | + if( $valid = User::isValidEmailAddr( $recipient ) ) $this->recipients[] = $recipient; |
281 | 235 | return $valid; |
282 | 236 | } |
283 | 237 | |
— | — | @@ -291,17 +245,17 @@ |
292 | 246 | $tbl = $dbr->tableName( 'templatelinks' ); |
293 | 247 | $type = $dbr->addQuotes( $this->record ); |
294 | 248 | $res = $dbr->select( $tbl, 'tl_from', "tl_namespace = 10 AND tl_title = $type", __METHOD__ ); |
295 | | - while ( $row = $dbr->fetchRow( $res ) ) { |
| 249 | + while( $row = $dbr->fetchRow( $res ) ) { |
296 | 250 | $a = new Article( Title::newFromID( $row[0] ) ); |
297 | 251 | $c = $a->getContent(); |
298 | 252 | |
299 | 253 | # Check if this records email address matches |
300 | | - if ( preg_match( "|\s*\|\s*\w+\s*=\s*$email\s*(?=[\|\}])|s", $c ) ) { |
| 254 | + if( preg_match( "|\s*\|\s*\w+\s*=\s*$email\s*(?=[\|\}])|s", $c ) ) { |
301 | 255 | |
302 | 256 | # Extract all the fields from the content (should use examineBraces here) |
303 | 257 | $this->args = array(); |
304 | 258 | preg_match_all( "|\|\s*(.+?)\s*=\s*(.*?)\s*(?=[\|\}])|s", $c, $m ); |
305 | | - foreach ( $m[1] as $i => $k ) $this->args[strtolower( $k )] = $m[2][$i]; |
| 259 | + foreach( $m[1] as $i => $k ) $this->args[strtolower( $k )] = $m[2][$i]; |
306 | 260 | |
307 | 261 | # Replace any fields in the message text with our extracted args (should use wiki parser for this) |
308 | 262 | $text = preg_replace_callback( "|\{(\w+)(\|(.+?))?\}|s", array( $this, 'replaceField' ), $text ); |
— | — | @@ -319,8 +273,9 @@ |
320 | 274 | function replaceField( $match ) { |
321 | 275 | $key = strtolower( $match[1] ); |
322 | 276 | $default = isset( $match[3] ) ? $match[3] : false; |
323 | | - if ( array_key_exists( $key, $this->args ) ) $replace = $this->args[$key]; |
| 277 | + if( array_key_exists( $key, $this->args ) ) $replace = $this->args[$key]; |
324 | 278 | else $replace = $default ? $default : $match[0]; |
325 | 279 | return $replace; |
326 | 280 | } |
327 | 281 | } |
| 282 | + |
Index: trunk/extensions/EmailPage/EmailPage.php |
— | — | @@ -12,16 +12,15 @@ |
13 | 13 | */ |
14 | 14 | if( !defined( 'MEDIAWIKI' ) ) die( "Not an entry point." ); |
15 | 15 | |
16 | | -define( 'EMAILPAGE_VERSION', "1.3.6, 2010-09-21" ); |
| 16 | +define( 'EMAILPAGE_VERSION', "1.4.0, 2010-10-29" ); |
17 | 17 | |
18 | 18 | $wgEmailPageGroup = "sysop"; # Users must belong to this group to send emails (empty string means anyone can send) |
19 | | -$wgEmailPageContactsCat = ""; # This specifies the name of a category containing categories of contact pages |
20 | 19 | $wgEmailPageCss = "EmailPage.css"; # A minimal CSS page to embed in the email (eg. monobook/main.css without portlets, actions etc) |
21 | 20 | $wgEmailPageAllowRemoteAddr = array( "127.0.0.1" ); # Allow anonymous sending from these addresses |
22 | 21 | $wgEmailPageAllowAllUsers = false; # Whether to allow sending to all users (the "user" group) |
23 | 22 | $wgEmailPageToolboxLink = true; # Add a link to the sidebar toolbox? |
24 | 23 | $wgEmailPageActionLink = true; # Add a link to the actions links? |
25 | | -$wgPhpMailerClass = dirname( __FILE__ ) . "/phpMailer_v2.1.0beta2/class.phpmailer.php"; # From http://phpmailer.sourceforge.net/ |
| 24 | +$wgPhpMailerClass = dirname( __FILE__ ) . "/PHPMailer_v5.1/class.phpmailer.php"; # From http://phpmailer.sourceforge.net/ |
26 | 25 | |
27 | 26 | if( $wgEmailPageGroup ) $wgGroupPermissions['sysop'][$wgEmailPageGroup] = true; |
28 | 27 | |
— | — | @@ -43,11 +42,11 @@ |
44 | 43 | ); |
45 | 44 | |
46 | 45 | # If form has been posted, include the phpmailer class |
47 | | -if ( isset( $_REQUEST['ea-send'] ) ) require_once( $wgPhpMailerClass ); |
| 46 | +if( isset( $_REQUEST['ea-send'] ) ) require_once( $wgPhpMailerClass ); |
48 | 47 | |
49 | 48 | # Add toolbox and action links |
50 | | -if ( $wgEmailPageToolboxLink ) $wgHooks['SkinTemplateToolboxEnd'][] = 'wfEmailPageToolboxLink'; |
51 | | -if ( $wgEmailPageActionLink ) { |
| 49 | +if( $wgEmailPageToolboxLink ) $wgHooks['SkinTemplateToolboxEnd'][] = 'wfEmailPageToolboxLink'; |
| 50 | +if( $wgEmailPageActionLink ) { |
52 | 51 | $wgHooks['SkinTemplateTabs'][] = 'wfEmailPageActionLink'; |
53 | 52 | $wgHooks['SkinTemplateNavigation'][] = 'wfEmailPageActionLinkVector'; |
54 | 53 | } |
— | — | @@ -63,7 +62,7 @@ |
64 | 63 | |
65 | 64 | function wfEmailPageActionLink( $skin, &$actions ) { |
66 | 65 | global $wgTitle, $wgUser, $wgEmailPageGroup; |
67 | | - if ( is_object( $wgTitle ) && ( empty( $wgEmailPageGroup ) || in_array( $wgEmailPageGroup, $wgUser->getEffectiveGroups() ) ) ) { |
| 66 | + if( is_object( $wgTitle ) && ( empty( $wgEmailPageGroup ) || in_array( $wgEmailPageGroup, $wgUser->getEffectiveGroups() ) ) ) { |
68 | 67 | $url = SpecialPage::getTitleFor( 'EmailPage' )->getLocalURL( array( 'ea-title' => $wgTitle->getPrefixedText() ) ); |
69 | 68 | $actions['email'] = array( 'text' => wfMsg( 'email' ), 'class' => false, 'href' => $url ); |
70 | 69 | } |
— | — | @@ -72,7 +71,7 @@ |
73 | 72 | |
74 | 73 | function wfEmailPageActionLinkVector( $skin, &$actions ) { |
75 | 74 | global $wgTitle, $wgUser, $wgEmailPageGroup; |
76 | | - if ( is_object( $wgTitle ) && ( empty( $wgEmailPageGroup ) || in_array( $wgEmailPageGroup, $wgUser->getEffectiveGroups() ) ) ) { |
| 75 | + if( is_object( $wgTitle ) && ( empty( $wgEmailPageGroup ) || in_array( $wgEmailPageGroup, $wgUser->getEffectiveGroups() ) ) ) { |
77 | 76 | $url = SpecialPage::getTitleFor( 'EmailPage' )->getLocalURL( array( 'ea-title' => $wgTitle->getPrefixedText() ) ); |
78 | 77 | $actions['views']['email'] = array( 'text' => wfMsg( 'email' ), 'class' => false, 'href' => $url ); |
79 | 78 | } |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/test/contents.html |
— | — | @@ -0,0 +1,10 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 3 | +<html> |
| 4 | + <head> |
| 5 | + <title>Email test</title> |
| 6 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 7 | + </head> |
| 8 | + <body> |
| 9 | + <p>Here is a test HTML email</p> |
| 10 | + </body> |
| 11 | +</html> |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/test/contents.html |
___________________________________________________________________ |
Added: svn:executable |
1 | 12 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/test/test_callback.php |
— | — | @@ -0,0 +1,84 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer Lite - DKIM and Callback Function test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +/* This is a sample callback function for PHPMailer Lite.
|
| 10 | + * This callback function will echo the results of PHPMailer processing.
|
| 11 | + */
|
| 12 | +
|
| 13 | +/* Callback (action) function
|
| 14 | + * bool $result result of the send action
|
| 15 | + * string $to email address of the recipient
|
| 16 | + * string $cc cc email addresses
|
| 17 | + * string $bcc bcc email addresses
|
| 18 | + * string $subject the subject
|
| 19 | + * string $body the email body
|
| 20 | + * @return boolean
|
| 21 | + */
|
| 22 | +function callbackAction ($result, $to, $cc, $bcc, $subject, $body) {
|
| 23 | + /*
|
| 24 | + this callback example echos the results to the screen - implement to
|
| 25 | + post to databases, build CSV log files, etc., with minor changes
|
| 26 | + */
|
| 27 | + $to = cleanEmails($to,'to');
|
| 28 | + $cc = cleanEmails($cc[0],'cc');
|
| 29 | + $bcc = cleanEmails($bcc[0],'cc');
|
| 30 | + echo $result . "\tTo: " . $to['Name'] . "\tTo: " . $to['Email'] . "\tCc: " . $cc['Name'] . "\tCc: " . $cc['Email'] . "\tBcc: " . $bcc['Name'] . "\tBcc: " . $bcc['Email'] . "\t" . $subject . "<br />\n";
|
| 31 | + return true;
|
| 32 | +}
|
| 33 | +
|
| 34 | +$testLite = false;
|
| 35 | +
|
| 36 | +if ($testLite) {
|
| 37 | + require_once '../class.phpmailer-lite.php';
|
| 38 | + $mail = new PHPMailerLite();
|
| 39 | +} else {
|
| 40 | + require_once '../class.phpmailer.php';
|
| 41 | + $mail = new PHPMailer();
|
| 42 | +}
|
| 43 | +
|
| 44 | +try {
|
| 45 | + $mail->IsMail(); // telling the class to use SMTP
|
| 46 | + $mail->SetFrom('you@yourdomain.com', 'Your Name');
|
| 47 | + $mail->AddAddress('another@yourdomain.com', 'John Doe');
|
| 48 | + $mail->Subject = 'PHPMailer Lite Test Subject via Mail()';
|
| 49 | + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
|
| 50 | + $mail->MsgHTML(file_get_contents('contents.html'));
|
| 51 | + $mail->AddAttachment('images/phpmailer.gif'); // attachment
|
| 52 | + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
|
| 53 | + $mail->action_function = 'callbackAction';
|
| 54 | + $mail->Send();
|
| 55 | + echo "Message Sent OK</p>\n";
|
| 56 | +} catch (phpmailerException $e) {
|
| 57 | + echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
| 58 | +} catch (Exception $e) {
|
| 59 | + echo $e->getMessage(); //Boring error messages from anything else!
|
| 60 | +}
|
| 61 | +
|
| 62 | +function cleanEmails($str,$type) {
|
| 63 | + if ($type == 'cc') {
|
| 64 | + $addy['Email'] = $str[0];
|
| 65 | + $addy['Name'] = $str[1];
|
| 66 | + return $addy;
|
| 67 | + }
|
| 68 | + if (!strstr($str, ' <')) {
|
| 69 | + $addy['Name'] = '';
|
| 70 | + $addy['Email'] = $addy;
|
| 71 | + return $addy;
|
| 72 | + }
|
| 73 | + $addyArr = explode(' <', $str);
|
| 74 | + if (substr($addyArr[1],-1) == '>') {
|
| 75 | + $addyArr[1] = substr($addyArr[1],0,-1);
|
| 76 | + }
|
| 77 | + $addy['Name'] = $addyArr[0];
|
| 78 | + $addy['Email'] = $addyArr[1];
|
| 79 | + $addy['Email'] = str_replace('@', '@', $addy['Email']);
|
| 80 | + return $addy;
|
| 81 | +}
|
| 82 | +
|
| 83 | +?>
|
| 84 | +</body>
|
| 85 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/test/test_callback.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 86 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/test/test.png |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/test/test.png |
___________________________________________________________________ |
Added: svn:mime-type |
2 | 87 | + application/octet-stream |
Added: svn:executable |
3 | 88 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/test/phpmailerTest.php |
— | — | @@ -0,0 +1,670 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer - PHP email transport unit tests
|
| 5 | +* Before running these tests you need to install PHPUnit 3.3 or later through pear, like this:
|
| 6 | +* pear install "channel://pear.phpunit.de/PHPUnit"
|
| 7 | +* Then run the tests like this:
|
| 8 | +* phpunit phpmailerTest
|
| 9 | +* @package PHPMailer
|
| 10 | +* @author Andy Prevost
|
| 11 | +* @author Marcus Bointon
|
| 12 | +* @copyright 2004 - 2009 Andy Prevost
|
| 13 | +* @version $Id: phpmailerTest.php 444 2009-05-05 11:22:26Z coolbru $
|
| 14 | +* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
| 15 | +*/
|
| 16 | +
|
| 17 | +require 'PHPUnit/Framework.php';
|
| 18 | +
|
| 19 | +$INCLUDE_DIR = "../";
|
| 20 | +
|
| 21 | +require $INCLUDE_DIR . 'class.phpmailer.php';
|
| 22 | +error_reporting(E_ALL);
|
| 23 | +
|
| 24 | +/**
|
| 25 | +* PHPMailer - PHP email transport unit test class
|
| 26 | +* Performs authentication tests
|
| 27 | +*/
|
| 28 | +class phpmailerTest extends PHPUnit_Framework_TestCase {
|
| 29 | + /**
|
| 30 | + * Holds the default phpmailer instance.
|
| 31 | + * @private
|
| 32 | + * @type object
|
| 33 | + */
|
| 34 | + var $Mail = false;
|
| 35 | +
|
| 36 | + /**
|
| 37 | + * Holds the SMTP mail host.
|
| 38 | + * @public
|
| 39 | + * @type string
|
| 40 | + */
|
| 41 | + var $Host = "";
|
| 42 | +
|
| 43 | + /**
|
| 44 | + * Holds the change log.
|
| 45 | + * @private
|
| 46 | + * @type string array
|
| 47 | + */
|
| 48 | + var $ChangeLog = array();
|
| 49 | +
|
| 50 | + /**
|
| 51 | + * Holds the note log.
|
| 52 | + * @private
|
| 53 | + * @type string array
|
| 54 | + */
|
| 55 | + var $NoteLog = array();
|
| 56 | +
|
| 57 | + /**
|
| 58 | + * Run before each test is started.
|
| 59 | + */
|
| 60 | + function setUp() {
|
| 61 | + global $INCLUDE_DIR;
|
| 62 | +
|
| 63 | + @include './testbootstrap.php'; //Overrides go in here
|
| 64 | +
|
| 65 | + $this->Mail = new PHPMailer();
|
| 66 | +
|
| 67 | + $this->Mail->Priority = 3;
|
| 68 | + $this->Mail->Encoding = "8bit";
|
| 69 | + $this->Mail->CharSet = "iso-8859-1";
|
| 70 | + if (array_key_exists('mail_from', $_REQUEST)) {
|
| 71 | + $this->Mail->From = $_REQUEST['mail_from'];
|
| 72 | + } else {
|
| 73 | + $this->Mail->From = 'unit_test@phpmailer.sf.net';
|
| 74 | + }
|
| 75 | + $this->Mail->FromName = "Unit Tester";
|
| 76 | + $this->Mail->Sender = "";
|
| 77 | + $this->Mail->Subject = "Unit Test";
|
| 78 | + $this->Mail->Body = "";
|
| 79 | + $this->Mail->AltBody = "";
|
| 80 | + $this->Mail->WordWrap = 0;
|
| 81 | + if (array_key_exists('mail_host', $_REQUEST)) {
|
| 82 | + $this->Mail->Host = $_REQUEST['mail_host'];
|
| 83 | + } else {
|
| 84 | + $this->Mail->Host = 'mail.example.com';
|
| 85 | + }
|
| 86 | + $this->Mail->Port = 25;
|
| 87 | + $this->Mail->Helo = "localhost.localdomain";
|
| 88 | + $this->Mail->SMTPAuth = false;
|
| 89 | + $this->Mail->Username = "";
|
| 90 | + $this->Mail->Password = "";
|
| 91 | + $this->Mail->PluginDir = $INCLUDE_DIR;
|
| 92 | + $this->Mail->AddReplyTo("no_reply@phpmailer.sf.net", "Reply Guy");
|
| 93 | + $this->Mail->Sender = "unit_test@phpmailer.sf.net";
|
| 94 | +
|
| 95 | + if(strlen($this->Mail->Host) > 0) {
|
| 96 | + $this->Mail->Mailer = "smtp";
|
| 97 | + } else {
|
| 98 | + $this->Mail->Mailer = "mail";
|
| 99 | + $this->Sender = "unit_test@phpmailer.sf.net";
|
| 100 | + }
|
| 101 | +
|
| 102 | + if (array_key_exists('mail_to', $_REQUEST)) {
|
| 103 | + $this->SetAddress($_REQUEST['mail_to'], 'Test User', 'to');
|
| 104 | + }
|
| 105 | + if (array_key_exists('mail_cc', $_REQUEST) and strlen($_REQUEST['mail_cc']) > 0) {
|
| 106 | + $this->SetAddress($_REQUEST['mail_cc'], 'Carbon User', 'cc');
|
| 107 | + }
|
| 108 | + }
|
| 109 | +
|
| 110 | + /**
|
| 111 | + * Run after each test is completed.
|
| 112 | + */
|
| 113 | + function tearDown() {
|
| 114 | + // Clean global variables
|
| 115 | + $this->Mail = NULL;
|
| 116 | + $this->ChangeLog = array();
|
| 117 | + $this->NoteLog = array();
|
| 118 | + }
|
| 119 | +
|
| 120 | +
|
| 121 | + /**
|
| 122 | + * Build the body of the message in the appropriate format.
|
| 123 | + * @private
|
| 124 | + * @returns void
|
| 125 | + */
|
| 126 | + function BuildBody() {
|
| 127 | + $this->CheckChanges();
|
| 128 | +
|
| 129 | + // Determine line endings for message
|
| 130 | + if($this->Mail->ContentType == "text/html" || strlen($this->Mail->AltBody) > 0)
|
| 131 | + {
|
| 132 | + $eol = "<br/>";
|
| 133 | + $bullet = "<li>";
|
| 134 | + $bullet_start = "<ul>";
|
| 135 | + $bullet_end = "</ul>";
|
| 136 | + }
|
| 137 | + else
|
| 138 | + {
|
| 139 | + $eol = "\n";
|
| 140 | + $bullet = " - ";
|
| 141 | + $bullet_start = "";
|
| 142 | + $bullet_end = "";
|
| 143 | + }
|
| 144 | +
|
| 145 | + $ReportBody = "";
|
| 146 | +
|
| 147 | + $ReportBody .= "---------------------" . $eol;
|
| 148 | + $ReportBody .= "Unit Test Information" . $eol;
|
| 149 | + $ReportBody .= "---------------------" . $eol;
|
| 150 | + $ReportBody .= "phpmailer version: " . PHPMailer::VERSION . $eol;
|
| 151 | + $ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;
|
| 152 | +
|
| 153 | + if(strlen($this->Mail->Host) > 0)
|
| 154 | + $ReportBody .= "Host: " . $this->Mail->Host . $eol;
|
| 155 | +
|
| 156 | + // If attachments then create an attachment list
|
| 157 | + $attachments = $this->Mail->GetAttachments();
|
| 158 | + if(count($attachments) > 0)
|
| 159 | + {
|
| 160 | + $ReportBody .= "Attachments:" . $eol;
|
| 161 | + $ReportBody .= $bullet_start;
|
| 162 | + foreach($attachments as $attachment) {
|
| 163 | + $ReportBody .= $bullet . "Name: " . $attachment[1] . ", ";
|
| 164 | + $ReportBody .= "Encoding: " . $attachment[3] . ", ";
|
| 165 | + $ReportBody .= "Type: " . $attachment[4] . $eol;
|
| 166 | + }
|
| 167 | + $ReportBody .= $bullet_end . $eol;
|
| 168 | + }
|
| 169 | +
|
| 170 | + // If there are changes then list them
|
| 171 | + if(count($this->ChangeLog) > 0)
|
| 172 | + {
|
| 173 | + $ReportBody .= "Changes" . $eol;
|
| 174 | + $ReportBody .= "-------" . $eol;
|
| 175 | +
|
| 176 | + $ReportBody .= $bullet_start;
|
| 177 | + for($i = 0; $i < count($this->ChangeLog); $i++)
|
| 178 | + {
|
| 179 | + $ReportBody .= $bullet . $this->ChangeLog[$i][0] . " was changed to [" .
|
| 180 | + $this->ChangeLog[$i][1] . "]" . $eol;
|
| 181 | + }
|
| 182 | + $ReportBody .= $bullet_end . $eol . $eol;
|
| 183 | + }
|
| 184 | +
|
| 185 | + // If there are notes then list them
|
| 186 | + if(count($this->NoteLog) > 0)
|
| 187 | + {
|
| 188 | + $ReportBody .= "Notes" . $eol;
|
| 189 | + $ReportBody .= "-----" . $eol;
|
| 190 | +
|
| 191 | + $ReportBody .= $bullet_start;
|
| 192 | + for($i = 0; $i < count($this->NoteLog); $i++)
|
| 193 | + {
|
| 194 | + $ReportBody .= $bullet . $this->NoteLog[$i] . $eol;
|
| 195 | + }
|
| 196 | + $ReportBody .= $bullet_end;
|
| 197 | + }
|
| 198 | +
|
| 199 | + // Re-attach the original body
|
| 200 | + $this->Mail->Body .= $eol . $eol . $ReportBody;
|
| 201 | + }
|
| 202 | +
|
| 203 | + /**
|
| 204 | + * Check which default settings have been changed for the report.
|
| 205 | + * @private
|
| 206 | + * @returns void
|
| 207 | + */
|
| 208 | + function CheckChanges() {
|
| 209 | + if($this->Mail->Priority != 3)
|
| 210 | + $this->AddChange("Priority", $this->Mail->Priority);
|
| 211 | + if($this->Mail->Encoding != "8bit")
|
| 212 | + $this->AddChange("Encoding", $this->Mail->Encoding);
|
| 213 | + if($this->Mail->CharSet != "iso-8859-1")
|
| 214 | + $this->AddChange("CharSet", $this->Mail->CharSet);
|
| 215 | + if($this->Mail->Sender != "")
|
| 216 | + $this->AddChange("Sender", $this->Mail->Sender);
|
| 217 | + if($this->Mail->WordWrap != 0)
|
| 218 | + $this->AddChange("WordWrap", $this->Mail->WordWrap);
|
| 219 | + if($this->Mail->Mailer != "mail")
|
| 220 | + $this->AddChange("Mailer", $this->Mail->Mailer);
|
| 221 | + if($this->Mail->Port != 25)
|
| 222 | + $this->AddChange("Port", $this->Mail->Port);
|
| 223 | + if($this->Mail->Helo != "localhost.localdomain")
|
| 224 | + $this->AddChange("Helo", $this->Mail->Helo);
|
| 225 | + if($this->Mail->SMTPAuth)
|
| 226 | + $this->AddChange("SMTPAuth", "true");
|
| 227 | + }
|
| 228 | +
|
| 229 | + /**
|
| 230 | + * Adds a change entry.
|
| 231 | + * @private
|
| 232 | + * @returns void
|
| 233 | + */
|
| 234 | + function AddChange($sName, $sNewValue) {
|
| 235 | + $cur = count($this->ChangeLog);
|
| 236 | + $this->ChangeLog[$cur][0] = $sName;
|
| 237 | + $this->ChangeLog[$cur][1] = $sNewValue;
|
| 238 | + }
|
| 239 | +
|
| 240 | + /**
|
| 241 | + * Adds a simple note to the message.
|
| 242 | + * @public
|
| 243 | + * @returns void
|
| 244 | + */
|
| 245 | + function AddNote($sValue) {
|
| 246 | + $this->NoteLog[] = $sValue;
|
| 247 | + }
|
| 248 | +
|
| 249 | + /**
|
| 250 | + * Adds all of the addresses
|
| 251 | + * @public
|
| 252 | + * @returns void
|
| 253 | + */
|
| 254 | + function SetAddress($sAddress, $sName = "", $sType = "to") {
|
| 255 | + switch($sType)
|
| 256 | + {
|
| 257 | + case "to":
|
| 258 | + return $this->Mail->AddAddress($sAddress, $sName);
|
| 259 | + case "cc":
|
| 260 | + return $this->Mail->AddCC($sAddress, $sName);
|
| 261 | + case "bcc":
|
| 262 | + return $this->Mail->AddBCC($sAddress, $sName);
|
| 263 | + }
|
| 264 | + }
|
| 265 | +
|
| 266 | + /////////////////////////////////////////////////
|
| 267 | + // UNIT TESTS
|
| 268 | + /////////////////////////////////////////////////
|
| 269 | +
|
| 270 | + /**
|
| 271 | + * Try a plain message.
|
| 272 | + */
|
| 273 | + function test_WordWrap() {
|
| 274 | +
|
| 275 | + $this->Mail->WordWrap = 40;
|
| 276 | + $my_body = "Here is the main body of this message. It should " .
|
| 277 | + "be quite a few lines. It should be wrapped at the " .
|
| 278 | + "40 characters. Make sure that it is.";
|
| 279 | + $nBodyLen = strlen($my_body);
|
| 280 | + $my_body .= "\n\nThis is the above body length: " . $nBodyLen;
|
| 281 | +
|
| 282 | + $this->Mail->Body = $my_body;
|
| 283 | + $this->Mail->Subject .= ": Wordwrap";
|
| 284 | +
|
| 285 | + $this->BuildBody();
|
| 286 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 287 | + }
|
| 288 | +
|
| 289 | + /**
|
| 290 | + * Try a plain message.
|
| 291 | + */
|
| 292 | + function test_Low_Priority() {
|
| 293 | +
|
| 294 | + $this->Mail->Priority = 5;
|
| 295 | + $this->Mail->Body = "Here is the main body. There should be " .
|
| 296 | + "a reply to address in this message.";
|
| 297 | + $this->Mail->Subject .= ": Low Priority";
|
| 298 | + $this->Mail->AddReplyTo("nobody@nobody.com", "Nobody (Unit Test)");
|
| 299 | +
|
| 300 | + $this->BuildBody();
|
| 301 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 302 | + }
|
| 303 | +
|
| 304 | + /**
|
| 305 | + * Simple plain file attachment test.
|
| 306 | + */
|
| 307 | + function test_Multiple_Plain_FileAttachment() {
|
| 308 | +
|
| 309 | + $this->Mail->Body = "Here is the text body";
|
| 310 | + $this->Mail->Subject .= ": Plain + Multiple FileAttachments";
|
| 311 | +
|
| 312 | + if(!$this->Mail->AddAttachment("test.png"))
|
| 313 | + {
|
| 314 | + $this->assertTrue(false, $this->Mail->ErrorInfo);
|
| 315 | + return;
|
| 316 | + }
|
| 317 | +
|
| 318 | + if(!$this->Mail->AddAttachment(__FILE__, "test.txt"))
|
| 319 | + {
|
| 320 | + $this->assertTrue(false, $this->Mail->ErrorInfo);
|
| 321 | + return;
|
| 322 | + }
|
| 323 | +
|
| 324 | + $this->BuildBody();
|
| 325 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 326 | + }
|
| 327 | +
|
| 328 | + /**
|
| 329 | + * Simple plain string attachment test.
|
| 330 | + */
|
| 331 | + function test_Plain_StringAttachment() {
|
| 332 | +
|
| 333 | + $this->Mail->Body = "Here is the text body";
|
| 334 | + $this->Mail->Subject .= ": Plain + StringAttachment";
|
| 335 | +
|
| 336 | + $sAttachment = "These characters are the content of the " .
|
| 337 | + "string attachment.\nThis might be taken from a ".
|
| 338 | + "database or some other such thing. ";
|
| 339 | +
|
| 340 | + $this->Mail->AddStringAttachment($sAttachment, "string_attach.txt");
|
| 341 | +
|
| 342 | + $this->BuildBody();
|
| 343 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 344 | + }
|
| 345 | +
|
| 346 | + /**
|
| 347 | + * Plain quoted-printable message.
|
| 348 | + */
|
| 349 | + function test_Quoted_Printable() {
|
| 350 | +
|
| 351 | + $this->Mail->Body = "Here is the main body";
|
| 352 | + $this->Mail->Subject .= ": Plain + Quoted-printable";
|
| 353 | + $this->Mail->Encoding = "quoted-printable";
|
| 354 | +
|
| 355 | + $this->BuildBody();
|
| 356 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 357 | +
|
| 358 | + //Check that a quoted printable encode and decode results in the same as went in
|
| 359 | + $t = substr(file_get_contents(__FILE__), 0, 1024); //Just pick a chunk of this file as test content
|
| 360 | + $this->assertEquals($t, quoted_printable_decode($this->Mail->EncodeQP($t)), 'QP encoding round-trip failed');
|
| 361 | + //$this->assertEquals($t, quoted_printable_decode($this->Mail->EncodeQPphp($t)), 'Native PHP QP encoding round-trip failed'); //TODO the PHP qp encoder is quite broken
|
| 362 | +
|
| 363 | + }
|
| 364 | +
|
| 365 | + /**
|
| 366 | + * Try a plain message.
|
| 367 | + */
|
| 368 | + function test_Html() {
|
| 369 | +
|
| 370 | + $this->Mail->IsHTML(true);
|
| 371 | + $this->Mail->Subject .= ": HTML only";
|
| 372 | +
|
| 373 | + $this->Mail->Body = "This is a <b>test message</b> written in HTML. </br>" .
|
| 374 | + "Go to <a href=\"http://phpmailer.sourceforge.net/\">" .
|
| 375 | + "http://phpmailer.sourceforge.net/</a> for new versions of " .
|
| 376 | + "phpmailer. <p/> Thank you!";
|
| 377 | +
|
| 378 | + $this->BuildBody();
|
| 379 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 380 | + }
|
| 381 | +
|
| 382 | + /**
|
| 383 | + * Simple HTML and attachment test
|
| 384 | + */
|
| 385 | + function test_HTML_Attachment() {
|
| 386 | +
|
| 387 | + $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
|
| 388 | + $this->Mail->Subject .= ": HTML + Attachment";
|
| 389 | + $this->Mail->IsHTML(true);
|
| 390 | +
|
| 391 | + if(!$this->Mail->AddAttachment(__FILE__, "test_attach.txt"))
|
| 392 | + {
|
| 393 | + $this->assertTrue(false, $this->Mail->ErrorInfo);
|
| 394 | + return;
|
| 395 | + }
|
| 396 | +
|
| 397 | + $this->BuildBody();
|
| 398 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 399 | + }
|
| 400 | +
|
| 401 | + /**
|
| 402 | + * An embedded attachment test.
|
| 403 | + */
|
| 404 | + function test_Embedded_Image() {
|
| 405 | +
|
| 406 | + $this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
|
| 407 | + "Here is an image!</a>";
|
| 408 | + $this->Mail->Subject .= ": Embedded Image";
|
| 409 | + $this->Mail->IsHTML(true);
|
| 410 | +
|
| 411 | + if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
|
| 412 | + "base64", "image/png"))
|
| 413 | + {
|
| 414 | + $this->assertTrue(false, $this->Mail->ErrorInfo);
|
| 415 | + return;
|
| 416 | + }
|
| 417 | +
|
| 418 | + $this->BuildBody();
|
| 419 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 420 | + //For code coverage
|
| 421 | + $this->Mail->AddEmbeddedImage('thisfiledoesntexist', 'xyz'); //Non-existent file
|
| 422 | + $this->Mail->AddEmbeddedImage(__FILE__, '123'); //Missing name
|
| 423 | +
|
| 424 | + }
|
| 425 | +
|
| 426 | + /**
|
| 427 | + * An embedded attachment test.
|
| 428 | + */
|
| 429 | + function test_Multi_Embedded_Image() {
|
| 430 | +
|
| 431 | + $this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
|
| 432 | + "Here is an image!</a>";
|
| 433 | + $this->Mail->Subject .= ": Embedded Image + Attachment";
|
| 434 | + $this->Mail->IsHTML(true);
|
| 435 | +
|
| 436 | + if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
|
| 437 | + "base64", "image/png"))
|
| 438 | + {
|
| 439 | + $this->assertTrue(false, $this->Mail->ErrorInfo);
|
| 440 | + return;
|
| 441 | + }
|
| 442 | +
|
| 443 | + if(!$this->Mail->AddAttachment(__FILE__, "test.txt"))
|
| 444 | + {
|
| 445 | + $this->assertTrue(false, $this->Mail->ErrorInfo);
|
| 446 | + return;
|
| 447 | + }
|
| 448 | +
|
| 449 | + $this->BuildBody();
|
| 450 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 451 | + }
|
| 452 | +
|
| 453 | + /**
|
| 454 | + * Simple multipart/alternative test.
|
| 455 | + */
|
| 456 | + function test_AltBody() {
|
| 457 | +
|
| 458 | + $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
|
| 459 | + $this->Mail->AltBody = "Here is the text body of this message. " .
|
| 460 | + "It should be quite a few lines. It should be wrapped at the " .
|
| 461 | + "40 characters. Make sure that it is.";
|
| 462 | + $this->Mail->WordWrap = 40;
|
| 463 | + $this->AddNote("This is a mulipart alternative email");
|
| 464 | + $this->Mail->Subject .= ": AltBody + Word Wrap";
|
| 465 | +
|
| 466 | + $this->BuildBody();
|
| 467 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 468 | + }
|
| 469 | +
|
| 470 | + /**
|
| 471 | + * Simple HTML and attachment test
|
| 472 | + */
|
| 473 | + function test_AltBody_Attachment() {
|
| 474 | +
|
| 475 | + $this->Mail->Body = "This is the <b>HTML</b> part of the email.";
|
| 476 | + $this->Mail->AltBody = "This is the text part of the email.";
|
| 477 | + $this->Mail->Subject .= ": AltBody + Attachment";
|
| 478 | + $this->Mail->IsHTML(true);
|
| 479 | +
|
| 480 | + if(!$this->Mail->AddAttachment(__FILE__, "test_attach.txt"))
|
| 481 | + {
|
| 482 | + $this->assertTrue(false, $this->Mail->ErrorInfo);
|
| 483 | + return;
|
| 484 | + }
|
| 485 | +
|
| 486 | + $this->BuildBody();
|
| 487 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 488 | + if (is_writable('.')) {
|
| 489 | + file_put_contents('message.txt', $this->Mail->CreateHeader() . $this->Mail->CreateBody());
|
| 490 | + } else {
|
| 491 | + $this->assertTrue(false, 'Could not write local file - check permissions');
|
| 492 | + }
|
| 493 | + }
|
| 494 | +
|
| 495 | + function test_MultipleSend() {
|
| 496 | + $this->Mail->Body = "Sending two messages without keepalive";
|
| 497 | + $this->BuildBody();
|
| 498 | + $subject = $this->Mail->Subject;
|
| 499 | +
|
| 500 | + $this->Mail->Subject = $subject . ": SMTP 1";
|
| 501 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 502 | +
|
| 503 | + $this->Mail->Subject = $subject . ": SMTP 2";
|
| 504 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 505 | + }
|
| 506 | +
|
| 507 | + function test_SendmailSend() {
|
| 508 | + $this->Mail->Body = "Sending via sendmail";
|
| 509 | + $this->BuildBody();
|
| 510 | + $subject = $this->Mail->Subject;
|
| 511 | +
|
| 512 | + $this->Mail->Subject = $subject . ": sendmail";
|
| 513 | + $this->Mail->IsSendmail();
|
| 514 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 515 | + }
|
| 516 | +
|
| 517 | + function test_MailSend() {
|
| 518 | + $this->Mail->Body = "Sending via mail()";
|
| 519 | + $this->BuildBody();
|
| 520 | + $subject = $this->Mail->Subject;
|
| 521 | +
|
| 522 | + $this->Mail->Subject = $subject . ": mail()";
|
| 523 | + $this->Mail->IsMail();
|
| 524 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 525 | + }
|
| 526 | +
|
| 527 | + function test_SmtpKeepAlive() {
|
| 528 | + $this->Mail->Body = "This was done using the SMTP keep-alive.";
|
| 529 | + $this->BuildBody();
|
| 530 | + $subject = $this->Mail->Subject;
|
| 531 | +
|
| 532 | + $this->Mail->SMTPKeepAlive = true;
|
| 533 | + $this->Mail->Subject = $subject . ": SMTP keep-alive 1";
|
| 534 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 535 | +
|
| 536 | + $this->Mail->Subject = $subject . ": SMTP keep-alive 2";
|
| 537 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 538 | + $this->Mail->SmtpClose();
|
| 539 | + }
|
| 540 | +
|
| 541 | + /**
|
| 542 | + * Tests this denial of service attack:
|
| 543 | + * http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
|
| 544 | + */
|
| 545 | + function test_DenialOfServiceAttack() {
|
| 546 | + $this->Mail->Body = "This should no longer cause a denial of service.";
|
| 547 | + $this->BuildBody();
|
| 548 | +
|
| 549 | + $this->Mail->Subject = str_repeat("A", 998);
|
| 550 | + $this->assertTrue($this->Mail->Send(), $this->Mail->ErrorInfo);
|
| 551 | + }
|
| 552 | +
|
| 553 | + function test_Error() {
|
| 554 | + $this->Mail->Subject .= ": This should be sent";
|
| 555 | + $this->BuildBody();
|
| 556 | + $this->Mail->ClearAllRecipients(); // no addresses should cause an error
|
| 557 | + $this->assertTrue($this->Mail->IsError() == false, "Error found");
|
| 558 | + $this->assertTrue($this->Mail->Send() == false, "Send succeeded");
|
| 559 | + $this->assertTrue($this->Mail->IsError(), "No error found");
|
| 560 | + $this->assertEquals('You must provide at least one recipient email address.', $this->Mail->ErrorInfo);
|
| 561 | + $this->Mail->AddAddress($_REQUEST['mail_to']);
|
| 562 | + $this->assertTrue($this->Mail->Send(), "Send failed");
|
| 563 | + }
|
| 564 | +
|
| 565 | + function test_Addressing() {
|
| 566 | + $this->assertFalse($this->Mail->AddAddress('a@example..com'), 'Invalid address accepted');
|
| 567 | + $this->assertTrue($this->Mail->AddAddress('a@example.com'), 'Addressing failed');
|
| 568 | + $this->assertFalse($this->Mail->AddAddress('a@example.com'), 'Duplicate addressing failed');
|
| 569 | + $this->assertTrue($this->Mail->AddCC('b@example.com'), 'CC addressing failed');
|
| 570 | + $this->assertFalse($this->Mail->AddCC('b@example.com'), 'CC duplicate addressing failed');
|
| 571 | + $this->assertFalse($this->Mail->AddCC('a@example.com'), 'CC duplicate addressing failed (2)');
|
| 572 | + $this->assertTrue($this->Mail->AddBCC('c@example.com'), 'BCC addressing failed');
|
| 573 | + $this->assertFalse($this->Mail->AddBCC('c@example.com'), 'BCC duplicate addressing failed');
|
| 574 | + $this->assertFalse($this->Mail->AddBCC('a@example.com'), 'BCC duplicate addressing failed (2)');
|
| 575 | + $this->assertTrue($this->Mail->AddReplyTo('a@example.com'), 'Replyto Addressing failed');
|
| 576 | + $this->assertFalse($this->Mail->AddReplyTo('a@example..com'), 'Invalid Replyto address accepted');
|
| 577 | + $this->Mail->ClearAddresses();
|
| 578 | + $this->Mail->ClearCCs();
|
| 579 | + $this->Mail->ClearBCCs();
|
| 580 | + $this->Mail->ClearReplyTos();
|
| 581 | + }
|
| 582 | +
|
| 583 | + /**
|
| 584 | + * Test language files for missing and excess translations
|
| 585 | + * All languages are compared with English
|
| 586 | + */
|
| 587 | + function test_Translations() {
|
| 588 | + $this->Mail->SetLanguage('en');
|
| 589 | + $definedStrings = $this->Mail->GetTranslations();
|
| 590 | + foreach (new DirectoryIterator('../language') as $fileInfo) {
|
| 591 | + if($fileInfo->isDot()) continue;
|
| 592 | + $matches = array();
|
| 593 | + //Only look at language files, ignore anything else in there
|
| 594 | + if (preg_match('/^phpmailer\.lang-([a-z_]{2,})\.php$/', $fileInfo->getFilename(), $matches)) {
|
| 595 | + $lang = $matches[1]; //Extract language code
|
| 596 | + $PHPMAILER_LANG = array(); //Language strings get put in here
|
| 597 | + include $fileInfo->getPathname(); //Get language strings
|
| 598 | + $missing = array_diff(array_keys($definedStrings), array_keys($PHPMAILER_LANG));
|
| 599 | + $extra = array_diff(array_keys($PHPMAILER_LANG), array_keys($definedStrings));
|
| 600 | + $this->assertTrue(empty($missing), "Missing translations in $lang: ". implode(', ', $missing));
|
| 601 | + $this->assertTrue(empty($extra), "Extra translations in $lang: ". implode(', ', $extra));
|
| 602 | + }
|
| 603 | + }
|
| 604 | + }
|
| 605 | +
|
| 606 | + /**
|
| 607 | + * Encoding tests
|
| 608 | + */
|
| 609 | + function test_Encodings() {
|
| 610 | + $this->Mail->Charset = 'iso-8859-1';
|
| 611 | + $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('�Hola! Se�or!', 'text'), 'Q Encoding (text) failed');
|
| 612 | + $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('�Hola! Se�or!', 'comment'), 'Q Encoding (comment) failed');
|
| 613 | + $this->assertEquals('=A1Hola!_Se=F1or!', $this->Mail->EncodeQ('�Hola! Se�or!', 'phrase'), 'Q Encoding (phrase) failed');
|
| 614 | + }
|
| 615 | +
|
| 616 | + /**
|
| 617 | + * Signing tests
|
| 618 | + */
|
| 619 | + function test_Signing() {
|
| 620 | + $this->Mail->Sign('certfile.txt', 'keyfile.txt', 'password'); //TODO this is not really testing signing, but at least helps coverage
|
| 621 | + }
|
| 622 | +
|
| 623 | + /**
|
| 624 | + * Miscellaneous calls to improve test coverage and some small tests
|
| 625 | + */
|
| 626 | + function test_Miscellaneous() {
|
| 627 | + $this->assertEquals('application/pdf', PHPMailer::_mime_types('pdf') , 'MIME TYPE lookup failed');
|
| 628 | + $this->Mail->AddCustomHeader('SomeHeader: Some Value');
|
| 629 | + $this->Mail->ClearCustomHeaders();
|
| 630 | + $this->Mail->ClearAttachments();
|
| 631 | + $this->Mail->IsHTML(false);
|
| 632 | + $this->Mail->IsSMTP();
|
| 633 | + $this->Mail->IsMail();
|
| 634 | + $this->Mail->IsSendMail();
|
| 635 | + $this->Mail->IsQmail();
|
| 636 | + $this->Mail->SetLanguage('fr');
|
| 637 | + $this->Mail->Sender = '';
|
| 638 | + $this->Mail->CreateHeader();
|
| 639 | + $this->assertFalse($this->Mail->set('x', 'y'), 'Invalid property set succeeded');
|
| 640 | + $this->assertTrue($this->Mail->set('Timeout', 11), 'Valid property set failed');
|
| 641 | + $this->Mail->getFile(__FILE__);
|
| 642 | + }
|
| 643 | +}
|
| 644 | +
|
| 645 | +/**
|
| 646 | +* This is a sample form for setting appropriate test values through a browser
|
| 647 | +* These values can also be set using a file called testbootstrap.php (not in svn) in the same folder as this script
|
| 648 | +* which is probably more useful if you run these tests a lot
|
| 649 | +<html>
|
| 650 | +<body>
|
| 651 | +<h3>phpmailer Unit Test</h3>
|
| 652 | +By entering a SMTP hostname it will automatically perform tests with SMTP.
|
| 653 | +
|
| 654 | +<form name="phpmailer_unit" action=__FILE__ method="get">
|
| 655 | +<input type="hidden" name="submitted" value="1"/>
|
| 656 | +From Address: <input type="text" size="50" name="mail_from" value="<?php echo get("mail_from"); ?>"/>
|
| 657 | +<br/>
|
| 658 | +To Address: <input type="text" size="50" name="mail_to" value="<?php echo get("mail_to"); ?>"/>
|
| 659 | +<br/>
|
| 660 | +Cc Address: <input type="text" size="50" name="mail_cc" value="<?php echo get("mail_cc"); ?>"/>
|
| 661 | +<br/>
|
| 662 | +SMTP Hostname: <input type="text" size="50" name="mail_host" value="<?php echo get("mail_host"); ?>"/>
|
| 663 | +<p/>
|
| 664 | +<input type="submit" value="Run Test"/>
|
| 665 | +
|
| 666 | +</form>
|
| 667 | +</body>
|
| 668 | +</html>
|
| 669 | + */
|
| 670 | +
|
| 671 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/test/phpmailerTest.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 672 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/test/testemail.php |
— | — | @@ -0,0 +1,48 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | +* Simple example script using PHPMailer with exceptions enabled |
| 5 | +* @package phpmailer |
| 6 | +* @version $Id$ |
| 7 | +*/ |
| 8 | + |
| 9 | +require '../class.phpmailer.php'; |
| 10 | + |
| 11 | +try { |
| 12 | + $mail = new PHPMailer(true); //New instance, with exceptions enabled |
| 13 | + |
| 14 | + $body = file_get_contents('contents.html'); |
| 15 | + $body = preg_replace('/\\\\/','', $body); //Strip backslashes |
| 16 | + |
| 17 | + $mail->IsSMTP(); // tell the class to use SMTP |
| 18 | + $mail->SMTPAuth = true; // enable SMTP authentication |
| 19 | + $mail->Port = 25; // set the SMTP server port |
| 20 | + $mail->Host = "mail.yourdomain.com"; // SMTP server |
| 21 | + $mail->Username = "name@domain.com"; // SMTP server username |
| 22 | + $mail->Password = "password"; // SMTP server password |
| 23 | + |
| 24 | + $mail->IsSendmail(); // tell the class to use Sendmail |
| 25 | + |
| 26 | + $mail->AddReplyTo("name@domain.com","First Last"); |
| 27 | + |
| 28 | + $mail->From = "name@domain.com"; |
| 29 | + $mail->FromName = "First Last"; |
| 30 | + |
| 31 | + $to = "someone@example...com"; |
| 32 | + |
| 33 | + $mail->AddAddress($to); |
| 34 | + |
| 35 | + $mail->Subject = "First PHPMailer Message"; |
| 36 | + |
| 37 | + $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test |
| 38 | + $mail->WordWrap = 80; // set word wrap |
| 39 | + |
| 40 | + $mail->MsgHTML($body); |
| 41 | + |
| 42 | + $mail->IsHTML(true); // send as HTML |
| 43 | + |
| 44 | + $mail->Send(); |
| 45 | + echo 'Message has been sent.'; |
| 46 | +} catch (phpmailerException $e) { |
| 47 | + echo $e->errorMessage(); |
| 48 | +} |
| 49 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/test/testemail.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 50 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/LICENSE |
— | — | @@ -0,0 +1,504 @@ |
| 2 | + GNU LESSER GENERAL PUBLIC LICENSE
|
| 3 | + Version 2.1, February 1999
|
| 4 | +
|
| 5 | + Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
| 6 | + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 7 | + Everyone is permitted to copy and distribute verbatim copies
|
| 8 | + of this license document, but changing it is not allowed.
|
| 9 | +
|
| 10 | +[This is the first released version of the Lesser GPL. It also counts
|
| 11 | + as the successor of the GNU Library Public License, version 2, hence
|
| 12 | + the version number 2.1.]
|
| 13 | +
|
| 14 | + Preamble
|
| 15 | +
|
| 16 | + The licenses for most software are designed to take away your
|
| 17 | +freedom to share and change it. By contrast, the GNU General Public
|
| 18 | +Licenses are intended to guarantee your freedom to share and change
|
| 19 | +free software--to make sure the software is free for all its users.
|
| 20 | +
|
| 21 | + This license, the Lesser General Public License, applies to some
|
| 22 | +specially designated software packages--typically libraries--of the
|
| 23 | +Free Software Foundation and other authors who decide to use it. You
|
| 24 | +can use it too, but we suggest you first think carefully about whether
|
| 25 | +this license or the ordinary General Public License is the better
|
| 26 | +strategy to use in any particular case, based on the explanations below.
|
| 27 | +
|
| 28 | + When we speak of free software, we are referring to freedom of use,
|
| 29 | +not price. Our General Public Licenses are designed to make sure that
|
| 30 | +you have the freedom to distribute copies of free software (and charge
|
| 31 | +for this service if you wish); that you receive source code or can get
|
| 32 | +it if you want it; that you can change the software and use pieces of
|
| 33 | +it in new free programs; and that you are informed that you can do
|
| 34 | +these things.
|
| 35 | +
|
| 36 | + To protect your rights, we need to make restrictions that forbid
|
| 37 | +distributors to deny you these rights or to ask you to surrender these
|
| 38 | +rights. These restrictions translate to certain responsibilities for
|
| 39 | +you if you distribute copies of the library or if you modify it.
|
| 40 | +
|
| 41 | + For example, if you distribute copies of the library, whether gratis
|
| 42 | +or for a fee, you must give the recipients all the rights that we gave
|
| 43 | +you. You must make sure that they, too, receive or can get the source
|
| 44 | +code. If you link other code with the library, you must provide
|
| 45 | +complete object files to the recipients, so that they can relink them
|
| 46 | +with the library after making changes to the library and recompiling
|
| 47 | +it. And you must show them these terms so they know their rights.
|
| 48 | +
|
| 49 | + We protect your rights with a two-step method: (1) we copyright the
|
| 50 | +library, and (2) we offer you this license, which gives you legal
|
| 51 | +permission to copy, distribute and/or modify the library.
|
| 52 | +
|
| 53 | + To protect each distributor, we want to make it very clear that
|
| 54 | +there is no warranty for the free library. Also, if the library is
|
| 55 | +modified by someone else and passed on, the recipients should know
|
| 56 | +that what they have is not the original version, so that the original
|
| 57 | +author's reputation will not be affected by problems that might be
|
| 58 | +introduced by others.
|
| 59 | +
|
| 60 | + Finally, software patents pose a constant threat to the existence of
|
| 61 | +any free program. We wish to make sure that a company cannot
|
| 62 | +effectively restrict the users of a free program by obtaining a
|
| 63 | +restrictive license from a patent holder. Therefore, we insist that
|
| 64 | +any patent license obtained for a version of the library must be
|
| 65 | +consistent with the full freedom of use specified in this license.
|
| 66 | +
|
| 67 | + Most GNU software, including some libraries, is covered by the
|
| 68 | +ordinary GNU General Public License. This license, the GNU Lesser
|
| 69 | +General Public License, applies to certain designated libraries, and
|
| 70 | +is quite different from the ordinary General Public License. We use
|
| 71 | +this license for certain libraries in order to permit linking those
|
| 72 | +libraries into non-free programs.
|
| 73 | +
|
| 74 | + When a program is linked with a library, whether statically or using
|
| 75 | +a shared library, the combination of the two is legally speaking a
|
| 76 | +combined work, a derivative of the original library. The ordinary
|
| 77 | +General Public License therefore permits such linking only if the
|
| 78 | +entire combination fits its criteria of freedom. The Lesser General
|
| 79 | +Public License permits more lax criteria for linking other code with
|
| 80 | +the library.
|
| 81 | +
|
| 82 | + We call this license the "Lesser" General Public License because it
|
| 83 | +does Less to protect the user's freedom than the ordinary General
|
| 84 | +Public License. It also provides other free software developers Less
|
| 85 | +of an advantage over competing non-free programs. These disadvantages
|
| 86 | +are the reason we use the ordinary General Public License for many
|
| 87 | +libraries. However, the Lesser license provides advantages in certain
|
| 88 | +special circumstances.
|
| 89 | +
|
| 90 | + For example, on rare occasions, there may be a special need to
|
| 91 | +encourage the widest possible use of a certain library, so that it becomes
|
| 92 | +a de-facto standard. To achieve this, non-free programs must be
|
| 93 | +allowed to use the library. A more frequent case is that a free
|
| 94 | +library does the same job as widely used non-free libraries. In this
|
| 95 | +case, there is little to gain by limiting the free library to free
|
| 96 | +software only, so we use the Lesser General Public License.
|
| 97 | +
|
| 98 | + In other cases, permission to use a particular library in non-free
|
| 99 | +programs enables a greater number of people to use a large body of
|
| 100 | +free software. For example, permission to use the GNU C Library in
|
| 101 | +non-free programs enables many more people to use the whole GNU
|
| 102 | +operating system, as well as its variant, the GNU/Linux operating
|
| 103 | +system.
|
| 104 | +
|
| 105 | + Although the Lesser General Public License is Less protective of the
|
| 106 | +users' freedom, it does ensure that the user of a program that is
|
| 107 | +linked with the Library has the freedom and the wherewithal to run
|
| 108 | +that program using a modified version of the Library.
|
| 109 | +
|
| 110 | + The precise terms and conditions for copying, distribution and
|
| 111 | +modification follow. Pay close attention to the difference between a
|
| 112 | +"work based on the library" and a "work that uses the library". The
|
| 113 | +former contains code derived from the library, whereas the latter must
|
| 114 | +be combined with the library in order to run.
|
| 115 | +
|
| 116 | + GNU LESSER GENERAL PUBLIC LICENSE
|
| 117 | + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
| 118 | +
|
| 119 | + 0. This License Agreement applies to any software library or other
|
| 120 | +program which contains a notice placed by the copyright holder or
|
| 121 | +other authorized party saying it may be distributed under the terms of
|
| 122 | +this Lesser General Public License (also called "this License").
|
| 123 | +Each licensee is addressed as "you".
|
| 124 | +
|
| 125 | + A "library" means a collection of software functions and/or data
|
| 126 | +prepared so as to be conveniently linked with application programs
|
| 127 | +(which use some of those functions and data) to form executables.
|
| 128 | +
|
| 129 | + The "Library", below, refers to any such software library or work
|
| 130 | +which has been distributed under these terms. A "work based on the
|
| 131 | +Library" means either the Library or any derivative work under
|
| 132 | +copyright law: that is to say, a work containing the Library or a
|
| 133 | +portion of it, either verbatim or with modifications and/or translated
|
| 134 | +straightforwardly into another language. (Hereinafter, translation is
|
| 135 | +included without limitation in the term "modification".)
|
| 136 | +
|
| 137 | + "Source code" for a work means the preferred form of the work for
|
| 138 | +making modifications to it. For a library, complete source code means
|
| 139 | +all the source code for all modules it contains, plus any associated
|
| 140 | +interface definition files, plus the scripts used to control compilation
|
| 141 | +and installation of the library.
|
| 142 | +
|
| 143 | + Activities other than copying, distribution and modification are not
|
| 144 | +covered by this License; they are outside its scope. The act of
|
| 145 | +running a program using the Library is not restricted, and output from
|
| 146 | +such a program is covered only if its contents constitute a work based
|
| 147 | +on the Library (independent of the use of the Library in a tool for
|
| 148 | +writing it). Whether that is true depends on what the Library does
|
| 149 | +and what the program that uses the Library does.
|
| 150 | +
|
| 151 | + 1. You may copy and distribute verbatim copies of the Library's
|
| 152 | +complete source code as you receive it, in any medium, provided that
|
| 153 | +you conspicuously and appropriately publish on each copy an
|
| 154 | +appropriate copyright notice and disclaimer of warranty; keep intact
|
| 155 | +all the notices that refer to this License and to the absence of any
|
| 156 | +warranty; and distribute a copy of this License along with the
|
| 157 | +Library.
|
| 158 | +
|
| 159 | + You may charge a fee for the physical act of transferring a copy,
|
| 160 | +and you may at your option offer warranty protection in exchange for a
|
| 161 | +fee.
|
| 162 | +
|
| 163 | + 2. You may modify your copy or copies of the Library or any portion
|
| 164 | +of it, thus forming a work based on the Library, and copy and
|
| 165 | +distribute such modifications or work under the terms of Section 1
|
| 166 | +above, provided that you also meet all of these conditions:
|
| 167 | +
|
| 168 | + a) The modified work must itself be a software library.
|
| 169 | +
|
| 170 | + b) You must cause the files modified to carry prominent notices
|
| 171 | + stating that you changed the files and the date of any change.
|
| 172 | +
|
| 173 | + c) You must cause the whole of the work to be licensed at no
|
| 174 | + charge to all third parties under the terms of this License.
|
| 175 | +
|
| 176 | + d) If a facility in the modified Library refers to a function or a
|
| 177 | + table of data to be supplied by an application program that uses
|
| 178 | + the facility, other than as an argument passed when the facility
|
| 179 | + is invoked, then you must make a good faith effort to ensure that,
|
| 180 | + in the event an application does not supply such function or
|
| 181 | + table, the facility still operates, and performs whatever part of
|
| 182 | + its purpose remains meaningful.
|
| 183 | +
|
| 184 | + (For example, a function in a library to compute square roots has
|
| 185 | + a purpose that is entirely well-defined independent of the
|
| 186 | + application. Therefore, Subsection 2d requires that any
|
| 187 | + application-supplied function or table used by this function must
|
| 188 | + be optional: if the application does not supply it, the square
|
| 189 | + root function must still compute square roots.)
|
| 190 | +
|
| 191 | +These requirements apply to the modified work as a whole. If
|
| 192 | +identifiable sections of that work are not derived from the Library,
|
| 193 | +and can be reasonably considered independent and separate works in
|
| 194 | +themselves, then this License, and its terms, do not apply to those
|
| 195 | +sections when you distribute them as separate works. But when you
|
| 196 | +distribute the same sections as part of a whole which is a work based
|
| 197 | +on the Library, the distribution of the whole must be on the terms of
|
| 198 | +this License, whose permissions for other licensees extend to the
|
| 199 | +entire whole, and thus to each and every part regardless of who wrote
|
| 200 | +it.
|
| 201 | +
|
| 202 | +Thus, it is not the intent of this section to claim rights or contest
|
| 203 | +your rights to work written entirely by you; rather, the intent is to
|
| 204 | +exercise the right to control the distribution of derivative or
|
| 205 | +collective works based on the Library.
|
| 206 | +
|
| 207 | +In addition, mere aggregation of another work not based on the Library
|
| 208 | +with the Library (or with a work based on the Library) on a volume of
|
| 209 | +a storage or distribution medium does not bring the other work under
|
| 210 | +the scope of this License.
|
| 211 | +
|
| 212 | + 3. You may opt to apply the terms of the ordinary GNU General Public
|
| 213 | +License instead of this License to a given copy of the Library. To do
|
| 214 | +this, you must alter all the notices that refer to this License, so
|
| 215 | +that they refer to the ordinary GNU General Public License, version 2,
|
| 216 | +instead of to this License. (If a newer version than version 2 of the
|
| 217 | +ordinary GNU General Public License has appeared, then you can specify
|
| 218 | +that version instead if you wish.) Do not make any other change in
|
| 219 | +these notices.
|
| 220 | +
|
| 221 | + Once this change is made in a given copy, it is irreversible for
|
| 222 | +that copy, so the ordinary GNU General Public License applies to all
|
| 223 | +subsequent copies and derivative works made from that copy.
|
| 224 | +
|
| 225 | + This option is useful when you wish to copy part of the code of
|
| 226 | +the Library into a program that is not a library.
|
| 227 | +
|
| 228 | + 4. You may copy and distribute the Library (or a portion or
|
| 229 | +derivative of it, under Section 2) in object code or executable form
|
| 230 | +under the terms of Sections 1 and 2 above provided that you accompany
|
| 231 | +it with the complete corresponding machine-readable source code, which
|
| 232 | +must be distributed under the terms of Sections 1 and 2 above on a
|
| 233 | +medium customarily used for software interchange.
|
| 234 | +
|
| 235 | + If distribution of object code is made by offering access to copy
|
| 236 | +from a designated place, then offering equivalent access to copy the
|
| 237 | +source code from the same place satisfies the requirement to
|
| 238 | +distribute the source code, even though third parties are not
|
| 239 | +compelled to copy the source along with the object code.
|
| 240 | +
|
| 241 | + 5. A program that contains no derivative of any portion of the
|
| 242 | +Library, but is designed to work with the Library by being compiled or
|
| 243 | +linked with it, is called a "work that uses the Library". Such a
|
| 244 | +work, in isolation, is not a derivative work of the Library, and
|
| 245 | +therefore falls outside the scope of this License.
|
| 246 | +
|
| 247 | + However, linking a "work that uses the Library" with the Library
|
| 248 | +creates an executable that is a derivative of the Library (because it
|
| 249 | +contains portions of the Library), rather than a "work that uses the
|
| 250 | +library". The executable is therefore covered by this License.
|
| 251 | +Section 6 states terms for distribution of such executables.
|
| 252 | +
|
| 253 | + When a "work that uses the Library" uses material from a header file
|
| 254 | +that is part of the Library, the object code for the work may be a
|
| 255 | +derivative work of the Library even though the source code is not.
|
| 256 | +Whether this is true is especially significant if the work can be
|
| 257 | +linked without the Library, or if the work is itself a library. The
|
| 258 | +threshold for this to be true is not precisely defined by law.
|
| 259 | +
|
| 260 | + If such an object file uses only numerical parameters, data
|
| 261 | +structure layouts and accessors, and small macros and small inline
|
| 262 | +functions (ten lines or less in length), then the use of the object
|
| 263 | +file is unrestricted, regardless of whether it is legally a derivative
|
| 264 | +work. (Executables containing this object code plus portions of the
|
| 265 | +Library will still fall under Section 6.)
|
| 266 | +
|
| 267 | + Otherwise, if the work is a derivative of the Library, you may
|
| 268 | +distribute the object code for the work under the terms of Section 6.
|
| 269 | +Any executables containing that work also fall under Section 6,
|
| 270 | +whether or not they are linked directly with the Library itself.
|
| 271 | +
|
| 272 | + 6. As an exception to the Sections above, you may also combine or
|
| 273 | +link a "work that uses the Library" with the Library to produce a
|
| 274 | +work containing portions of the Library, and distribute that work
|
| 275 | +under terms of your choice, provided that the terms permit
|
| 276 | +modification of the work for the customer's own use and reverse
|
| 277 | +engineering for debugging such modifications.
|
| 278 | +
|
| 279 | + You must give prominent notice with each copy of the work that the
|
| 280 | +Library is used in it and that the Library and its use are covered by
|
| 281 | +this License. You must supply a copy of this License. If the work
|
| 282 | +during execution displays copyright notices, you must include the
|
| 283 | +copyright notice for the Library among them, as well as a reference
|
| 284 | +directing the user to the copy of this License. Also, you must do one
|
| 285 | +of these things:
|
| 286 | +
|
| 287 | + a) Accompany the work with the complete corresponding
|
| 288 | + machine-readable source code for the Library including whatever
|
| 289 | + changes were used in the work (which must be distributed under
|
| 290 | + Sections 1 and 2 above); and, if the work is an executable linked
|
| 291 | + with the Library, with the complete machine-readable "work that
|
| 292 | + uses the Library", as object code and/or source code, so that the
|
| 293 | + user can modify the Library and then relink to produce a modified
|
| 294 | + executable containing the modified Library. (It is understood
|
| 295 | + that the user who changes the contents of definitions files in the
|
| 296 | + Library will not necessarily be able to recompile the application
|
| 297 | + to use the modified definitions.)
|
| 298 | +
|
| 299 | + b) Use a suitable shared library mechanism for linking with the
|
| 300 | + Library. A suitable mechanism is one that (1) uses at run time a
|
| 301 | + copy of the library already present on the user's computer system,
|
| 302 | + rather than copying library functions into the executable, and (2)
|
| 303 | + will operate properly with a modified version of the library, if
|
| 304 | + the user installs one, as long as the modified version is
|
| 305 | + interface-compatible with the version that the work was made with.
|
| 306 | +
|
| 307 | + c) Accompany the work with a written offer, valid for at
|
| 308 | + least three years, to give the same user the materials
|
| 309 | + specified in Subsection 6a, above, for a charge no more
|
| 310 | + than the cost of performing this distribution.
|
| 311 | +
|
| 312 | + d) If distribution of the work is made by offering access to copy
|
| 313 | + from a designated place, offer equivalent access to copy the above
|
| 314 | + specified materials from the same place.
|
| 315 | +
|
| 316 | + e) Verify that the user has already received a copy of these
|
| 317 | + materials or that you have already sent this user a copy.
|
| 318 | +
|
| 319 | + For an executable, the required form of the "work that uses the
|
| 320 | +Library" must include any data and utility programs needed for
|
| 321 | +reproducing the executable from it. However, as a special exception,
|
| 322 | +the materials to be distributed need not include anything that is
|
| 323 | +normally distributed (in either source or binary form) with the major
|
| 324 | +components (compiler, kernel, and so on) of the operating system on
|
| 325 | +which the executable runs, unless that component itself accompanies
|
| 326 | +the executable.
|
| 327 | +
|
| 328 | + It may happen that this requirement contradicts the license
|
| 329 | +restrictions of other proprietary libraries that do not normally
|
| 330 | +accompany the operating system. Such a contradiction means you cannot
|
| 331 | +use both them and the Library together in an executable that you
|
| 332 | +distribute.
|
| 333 | +
|
| 334 | + 7. You may place library facilities that are a work based on the
|
| 335 | +Library side-by-side in a single library together with other library
|
| 336 | +facilities not covered by this License, and distribute such a combined
|
| 337 | +library, provided that the separate distribution of the work based on
|
| 338 | +the Library and of the other library facilities is otherwise
|
| 339 | +permitted, and provided that you do these two things:
|
| 340 | +
|
| 341 | + a) Accompany the combined library with a copy of the same work
|
| 342 | + based on the Library, uncombined with any other library
|
| 343 | + facilities. This must be distributed under the terms of the
|
| 344 | + Sections above.
|
| 345 | +
|
| 346 | + b) Give prominent notice with the combined library of the fact
|
| 347 | + that part of it is a work based on the Library, and explaining
|
| 348 | + where to find the accompanying uncombined form of the same work.
|
| 349 | +
|
| 350 | + 8. You may not copy, modify, sublicense, link with, or distribute
|
| 351 | +the Library except as expressly provided under this License. Any
|
| 352 | +attempt otherwise to copy, modify, sublicense, link with, or
|
| 353 | +distribute the Library is void, and will automatically terminate your
|
| 354 | +rights under this License. However, parties who have received copies,
|
| 355 | +or rights, from you under this License will not have their licenses
|
| 356 | +terminated so long as such parties remain in full compliance.
|
| 357 | +
|
| 358 | + 9. You are not required to accept this License, since you have not
|
| 359 | +signed it. However, nothing else grants you permission to modify or
|
| 360 | +distribute the Library or its derivative works. These actions are
|
| 361 | +prohibited by law if you do not accept this License. Therefore, by
|
| 362 | +modifying or distributing the Library (or any work based on the
|
| 363 | +Library), you indicate your acceptance of this License to do so, and
|
| 364 | +all its terms and conditions for copying, distributing or modifying
|
| 365 | +the Library or works based on it.
|
| 366 | +
|
| 367 | + 10. Each time you redistribute the Library (or any work based on the
|
| 368 | +Library), the recipient automatically receives a license from the
|
| 369 | +original licensor to copy, distribute, link with or modify the Library
|
| 370 | +subject to these terms and conditions. You may not impose any further
|
| 371 | +restrictions on the recipients' exercise of the rights granted herein.
|
| 372 | +You are not responsible for enforcing compliance by third parties with
|
| 373 | +this License.
|
| 374 | +
|
| 375 | + 11. If, as a consequence of a court judgment or allegation of patent
|
| 376 | +infringement or for any other reason (not limited to patent issues),
|
| 377 | +conditions are imposed on you (whether by court order, agreement or
|
| 378 | +otherwise) that contradict the conditions of this License, they do not
|
| 379 | +excuse you from the conditions of this License. If you cannot
|
| 380 | +distribute so as to satisfy simultaneously your obligations under this
|
| 381 | +License and any other pertinent obligations, then as a consequence you
|
| 382 | +may not distribute the Library at all. For example, if a patent
|
| 383 | +license would not permit royalty-free redistribution of the Library by
|
| 384 | +all those who receive copies directly or indirectly through you, then
|
| 385 | +the only way you could satisfy both it and this License would be to
|
| 386 | +refrain entirely from distribution of the Library.
|
| 387 | +
|
| 388 | +If any portion of this section is held invalid or unenforceable under any
|
| 389 | +particular circumstance, the balance of the section is intended to apply,
|
| 390 | +and the section as a whole is intended to apply in other circumstances.
|
| 391 | +
|
| 392 | +It is not the purpose of this section to induce you to infringe any
|
| 393 | +patents or other property right claims or to contest validity of any
|
| 394 | +such claims; this section has the sole purpose of protecting the
|
| 395 | +integrity of the free software distribution system which is
|
| 396 | +implemented by public license practices. Many people have made
|
| 397 | +generous contributions to the wide range of software distributed
|
| 398 | +through that system in reliance on consistent application of that
|
| 399 | +system; it is up to the author/donor to decide if he or she is willing
|
| 400 | +to distribute software through any other system and a licensee cannot
|
| 401 | +impose that choice.
|
| 402 | +
|
| 403 | +This section is intended to make thoroughly clear what is believed to
|
| 404 | +be a consequence of the rest of this License.
|
| 405 | +
|
| 406 | + 12. If the distribution and/or use of the Library is restricted in
|
| 407 | +certain countries either by patents or by copyrighted interfaces, the
|
| 408 | +original copyright holder who places the Library under this License may add
|
| 409 | +an explicit geographical distribution limitation excluding those countries,
|
| 410 | +so that distribution is permitted only in or among countries not thus
|
| 411 | +excluded. In such case, this License incorporates the limitation as if
|
| 412 | +written in the body of this License.
|
| 413 | +
|
| 414 | + 13. The Free Software Foundation may publish revised and/or new
|
| 415 | +versions of the Lesser General Public License from time to time.
|
| 416 | +Such new versions will be similar in spirit to the present version,
|
| 417 | +but may differ in detail to address new problems or concerns.
|
| 418 | +
|
| 419 | +Each version is given a distinguishing version number. If the Library
|
| 420 | +specifies a version number of this License which applies to it and
|
| 421 | +"any later version", you have the option of following the terms and
|
| 422 | +conditions either of that version or of any later version published by
|
| 423 | +the Free Software Foundation. If the Library does not specify a
|
| 424 | +license version number, you may choose any version ever published by
|
| 425 | +the Free Software Foundation.
|
| 426 | +
|
| 427 | + 14. If you wish to incorporate parts of the Library into other free
|
| 428 | +programs whose distribution conditions are incompatible with these,
|
| 429 | +write to the author to ask for permission. For software which is
|
| 430 | +copyrighted by the Free Software Foundation, write to the Free
|
| 431 | +Software Foundation; we sometimes make exceptions for this. Our
|
| 432 | +decision will be guided by the two goals of preserving the free status
|
| 433 | +of all derivatives of our free software and of promoting the sharing
|
| 434 | +and reuse of software generally.
|
| 435 | +
|
| 436 | + NO WARRANTY
|
| 437 | +
|
| 438 | + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
| 439 | +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
| 440 | +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
| 441 | +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
| 442 | +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
| 443 | +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 444 | +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
| 445 | +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
| 446 | +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 447 | +
|
| 448 | + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
| 449 | +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
| 450 | +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
| 451 | +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
| 452 | +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
| 453 | +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
| 454 | +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
| 455 | +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
| 456 | +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
| 457 | +DAMAGES.
|
| 458 | +
|
| 459 | + END OF TERMS AND CONDITIONS
|
| 460 | +
|
| 461 | + How to Apply These Terms to Your New Libraries
|
| 462 | +
|
| 463 | + If you develop a new library, and you want it to be of the greatest
|
| 464 | +possible use to the public, we recommend making it free software that
|
| 465 | +everyone can redistribute and change. You can do so by permitting
|
| 466 | +redistribution under these terms (or, alternatively, under the terms of the
|
| 467 | +ordinary General Public License).
|
| 468 | +
|
| 469 | + To apply these terms, attach the following notices to the library. It is
|
| 470 | +safest to attach them to the start of each source file to most effectively
|
| 471 | +convey the exclusion of warranty; and each file should have at least the
|
| 472 | +"copyright" line and a pointer to where the full notice is found.
|
| 473 | +
|
| 474 | + <one line to give the library's name and a brief idea of what it does.>
|
| 475 | + Copyright (C) <year> <name of author>
|
| 476 | +
|
| 477 | + This library is free software; you can redistribute it and/or
|
| 478 | + modify it under the terms of the GNU Lesser General Public
|
| 479 | + License as published by the Free Software Foundation; either
|
| 480 | + version 2.1 of the License, or (at your option) any later version.
|
| 481 | +
|
| 482 | + This library is distributed in the hope that it will be useful,
|
| 483 | + but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 484 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| 485 | + Lesser General Public License for more details.
|
| 486 | +
|
| 487 | + You should have received a copy of the GNU Lesser General Public
|
| 488 | + License along with this library; if not, write to the Free Software
|
| 489 | + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 490 | +
|
| 491 | +Also add information on how to contact you by electronic and paper mail.
|
| 492 | +
|
| 493 | +You should also get your employer (if you work as a programmer) or your
|
| 494 | +school, if any, to sign a "copyright disclaimer" for the library, if
|
| 495 | +necessary. Here is a sample; alter the names:
|
| 496 | +
|
| 497 | + Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
| 498 | + library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
| 499 | +
|
| 500 | + <signature of Ty Coon>, 1 April 1990
|
| 501 | + Ty Coon, President of Vice
|
| 502 | +
|
| 503 | +That's all there is to it!
|
| 504 | +
|
| 505 | +
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/LICENSE |
___________________________________________________________________ |
Added: svn:executable |
1 | 506 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ch.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | +* PHPMailer language file: refer to English translation for definitive list |
| 5 | +* Chinese Version |
| 6 | +* By LiuXin: www.80x86.cn/blog/ |
| 7 | +*/ |
| 8 | + |
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。'; |
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。'; |
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。'; |
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; |
| 13 | +$PHPMAILER_LANG['encoding'] = '未知编码:'; |
| 14 | +$PHPMAILER_LANG['execute'] = '不能执行: '; |
| 15 | +$PHPMAILER_LANG['file_access'] = '不能访问文件:'; |
| 16 | +$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:'; |
| 17 | +$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: '; |
| 18 | +$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; |
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; |
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。'; |
| 21 | +$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; |
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: '; |
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; |
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; |
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; |
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; |
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ch.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ja.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Japanese Version
|
| 6 | +* By Mitsuhiro Yoshida - http://mitstek.com/
|
| 7 | +*/
|
| 8 | +
|
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
|
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';
|
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';
|
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 13 | +$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
|
| 14 | +$PHPMAILER_LANG['execute'] = '実行できませんでした: ';
|
| 15 | +$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
|
| 16 | +$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
|
| 17 | +$PHPMAILER_LANG['from_failed'] = '次のFromアドレスに間違いがあります: ';
|
| 18 | +$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
|
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 20 | +$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
|
| 21 | +$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
|
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
|
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ja.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-dk.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Danish Version
|
| 6 | +* Author: Mikael Stokkebro <info@stokkebro.dk>
|
| 7 | +*/
|
| 8 | +
|
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.';
|
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
|
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.';
|
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 13 | +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
|
| 14 | +$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: ';
|
| 15 | +$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: ';
|
| 16 | +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
|
| 17 | +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
|
| 18 | +$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.';
|
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
|
| 21 | +$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.';
|
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: ';
|
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-dk.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-fi.php |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Finnish Version
|
| 6 | +* By Jyry Kuukanen
|
| 7 | +*/
|
| 8 | +
|
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTP-virhe: käyttäjätunnistus epäonnistui.';
|
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
|
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-virhe: data on virheellinen.';
|
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 13 | +$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
|
| 14 | +$PHPMAILER_LANG['execute'] = 'Suoritus epäonnistui: ';
|
| 15 | +$PHPMAILER_LANG['file_access'] = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
|
| 16 | +$PHPMAILER_LANG['file_open'] = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
|
| 17 | +$PHPMAILER_LANG['from_failed'] = 'Seuraava lähettäjän osoite on virheellinen: ';
|
| 18 | +$PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.';
|
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';
|
| 21 | +$PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähköpostiosoite.';
|
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
|
| 23 | +$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
|
| 24 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 25 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 26 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 27 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 28 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-fi.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 29 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-zh_cn.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | +* PHPMailer language file: refer to English translation for definitive list |
| 5 | +* Simplified Chinese Version |
| 6 | +* @author liqwei <liqwei@liqwei.com> |
| 7 | +*/ |
| 8 | + |
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; |
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; |
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; |
| 12 | +//$P$PHPMAILER_LANG['empty_message'] = 'Message body empty'; |
| 13 | +$PHPMAILER_LANG['encoding'] = '未知编码: '; |
| 14 | +$PHPMAILER_LANG['execute'] = '无法执行:'; |
| 15 | +$PHPMAILER_LANG['file_access'] = '无法访问文件:'; |
| 16 | +$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; |
| 17 | +$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; |
| 18 | +$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; |
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; |
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; |
| 21 | +$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; |
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; |
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; |
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; |
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; |
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; |
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-zh_cn.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ar.php |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | +* PHPMailer language file: refer to English translation for definitive list |
| 5 | +* Arabic Version, UTF-8 |
| 6 | +* by : bahjat al mostafa <bahjat983@hotmail.com> |
| 7 | +*/ |
| 8 | + |
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: لم نستطع تأكيد الهوية.'; |
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: لم نستطع الاتصال بمخدم SMTP.'; |
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: لم يتم قبول المعلومات .'; |
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; |
| 13 | +$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; |
| 14 | +$PHPMAILER_LANG['execute'] = 'لم أستطع تنفيذ : '; |
| 15 | +$PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملف: '; |
| 16 | +$PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع فتح الملف: '; |
| 17 | +$PHPMAILER_LANG['from_failed'] = 'البريد التالي لم نستطع ارسال البريد له : '; |
| 18 | +$PHPMAILER_LANG['instantiate'] = 'لم نستطع توفير خدمة البريد.'; |
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; |
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.'; |
| 21 | +//$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.'; |
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: الأخطاء التالية ' . |
| 23 | + 'فشل في الارسال لكل من : '; |
| 24 | +$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; |
| 25 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; |
| 26 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; |
| 27 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; |
| 28 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ar.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 29 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-br.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Portuguese Version
|
| 6 | +* By Paulo Henrique Garcia - paulo@controllerweb.com.br
|
| 7 | +*/
|
| 8 | +
|
| 9 | +$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
|
| 10 | +$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar com o servidor SMTP.';
|
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados não aceitos.';
|
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 13 | +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
|
| 14 | +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
|
| 15 | +$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
|
| 16 | +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
|
| 17 | +$PHPMAILER_LANG['from_failed'] = 'Os endereços de rementente a seguir falharam: ';
|
| 18 | +$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
|
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não suportado.';
|
| 21 | +$PHPMAILER_LANG['provide_address'] = 'Você deve fornecer pelo menos um endereço de destinatário de email.';
|
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os endereços de destinatário a seguir falharam: ';
|
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-br.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-fo.php |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Faroese Version [language of the Faroe Islands, a Danish dominion]
|
| 6 | +* This file created: 11-06-2004
|
| 7 | +* Supplied by Dávur Sørensen [www.profo-webdesign.dk]
|
| 8 | +*/
|
| 9 | +
|
| 10 | +$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.';
|
| 11 | +$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
|
| 12 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.';
|
| 13 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 14 | +$PHPMAILER_LANG['encoding'] = 'Ókend encoding: ';
|
| 15 | +$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: ';
|
| 16 | +$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: ';
|
| 17 | +$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: ';
|
| 18 | +$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: ';
|
| 19 | +$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.';
|
| 20 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 21 | +$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';
|
| 22 | +$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).';
|
| 23 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: ';
|
| 24 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 25 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 26 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 27 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 28 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-fo.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 29 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-se.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Swedish Version
|
| 6 | +* Author: Johan Linnér <johan@linner.biz>
|
| 7 | +*/
|
| 8 | +
|
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.';
|
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
|
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.';
|
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 13 | +$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: ';
|
| 14 | +$PHPMAILER_LANG['execute'] = 'Kunde inte köra: ';
|
| 15 | +$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: ';
|
| 16 | +$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
|
| 17 | +$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: ';
|
| 18 | +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.';
|
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 20 | +$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
|
| 21 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
|
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
|
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-se.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-es.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Spanish version
|
| 6 | +* Versión en español
|
| 7 | +*/
|
| 8 | +
|
| 9 | +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No se pudo autentificar.';
|
| 10 | +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No puedo conectar al servidor SMTP.';
|
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.';
|
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 13 | +$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
|
| 14 | +$PHPMAILER_LANG['execute'] = 'No puedo ejecutar: ';
|
| 15 | +$PHPMAILER_LANG['file_access'] = 'No puedo acceder al archivo: ';
|
| 16 | +$PHPMAILER_LANG['file_open'] = 'Error de Archivo: No puede abrir el archivo: ';
|
| 17 | +$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
|
| 18 | +$PHPMAILER_LANG['instantiate'] = 'No pude crear una instancia de la función Mail.';
|
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
|
| 21 | +$PHPMAILER_LANG['provide_address'] = 'Debe proveer al menos una dirección de email como destinatario.';
|
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinatarios fallaron: ';
|
| 23 | +$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
|
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-es.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-fr.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* French Version
|
| 6 | +*/
|
| 7 | +
|
| 8 | +$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : Echec de l\'authentification.';
|
| 9 | +$PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : Impossible de se connecter au serveur SMTP.';
|
| 10 | +$PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : Données incorrects.';
|
| 11 | +$PHPMAILER_LANG['empty_message'] = 'Corps de message vide';
|
| 12 | +$PHPMAILER_LANG['encoding'] = 'Encodage inconnu : ';
|
| 13 | +$PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : ';
|
| 14 | +$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : ';
|
| 15 | +$PHPMAILER_LANG['file_open'] = 'Erreur Fichier : ouverture impossible : ';
|
| 16 | +$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échouée : ';
|
| 17 | +$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.';
|
| 18 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 19 | +$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
|
| 20 | +$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : Les destinataires suivants sont en erreur : ';
|
| 22 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 23 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 24 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 25 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 26 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-fr.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-et.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | +* PHPMailer language file: refer to English translation for definitive list |
| 5 | +* Estonian Version |
| 6 | +* By Indrek Päri |
| 7 | +*/ |
| 8 | + |
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; |
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; |
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; |
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; |
| 13 | +$PHPMAILER_LANG['encoding'] = 'Tundmatu Unknown kodeering: '; |
| 14 | +$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; |
| 15 | +$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; |
| 16 | +$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; |
| 17 | +$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; |
| 18 | +$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; |
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; |
| 20 | +$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; |
| 21 | +$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; |
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; |
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; |
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; |
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; |
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; |
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-et.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-nl.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Dutch Version
|
| 6 | +*/
|
| 7 | +
|
| 8 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Fout: authenticatie mislukt.';
|
| 9 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Fout: Kon niet verbinden met SMTP host.';
|
| 10 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Fout: Data niet geaccepteerd.';
|
| 11 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 12 | +$PHPMAILER_LANG['encoding'] = 'Onbekende codering: ';
|
| 13 | +$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: ';
|
| 14 | +$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: ';
|
| 15 | +$PHPMAILER_LANG['file_open'] = 'Bestandsfout: Kon bestand niet openen: ';
|
| 16 | +$PHPMAILER_LANG['from_failed'] = 'De volgende afzender adressen zijn mislukt: ';
|
| 17 | +$PHPMAILER_LANG['instantiate'] = 'Kon mail functie niet initialiseren.';
|
| 18 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 19 | +$PHPMAILER_LANG['provide_address'] = 'Er moet tenmiste één ontvanger emailadres opgegeven worden.';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Fout: De volgende ontvangers zijn mislukt: ';
|
| 22 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 23 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 24 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 25 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 26 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-nl.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-pl.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Polish Version
|
| 6 | +*/
|
| 7 | +
|
| 8 | +$PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić autentykacji.';
|
| 9 | +$PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.';
|
| 10 | +$PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.';
|
| 11 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 12 | +$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: ';
|
| 13 | +$PHPMAILER_LANG['execute'] = 'Nie można uruchomić: ';
|
| 14 | +$PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: ';
|
| 15 | +$PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: ';
|
| 16 | +$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest jest nieprawidłowy: ';
|
| 17 | +$PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.';
|
| 18 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 19 | +$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: ';
|
| 22 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 23 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 24 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 25 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 26 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-pl.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-hu.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Hungarian Version
|
| 6 | +*/
|
| 7 | +
|
| 8 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Hiba: Sikertelen autentikáció.';
|
| 9 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Hiba: Nem tudtam csatlakozni az SMTP host-hoz.';
|
| 10 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hiba: Nem elfogadható adat.';
|
| 11 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 12 | +$PHPMAILER_LANG['encoding'] = 'Ismeretlen kódolás: ';
|
| 13 | +$PHPMAILER_LANG['execute'] = 'Nem tudtam végrehajtani: ';
|
| 14 | +$PHPMAILER_LANG['file_access'] = 'Nem sikerült elérni a következõ fájlt: ';
|
| 15 | +$PHPMAILER_LANG['file_open'] = 'Fájl Hiba: Nem sikerült megnyitni a következõ fájlt: ';
|
| 16 | +$PHPMAILER_LANG['from_failed'] = 'Az alábbi Feladó cím hibás: ';
|
| 17 | +$PHPMAILER_LANG['instantiate'] = 'Nem sikerült példányosítani a mail funkciót.';
|
| 18 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 19 | +$PHPMAILER_LANG['provide_address'] = 'Meg kell adnod legalább egy címzett email címet.';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' levelezõ nem támogatott.';
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hiba: Az alábbi címzettek hibásak: ';
|
| 22 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 23 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 24 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 25 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 26 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-hu.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-it.php |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Italian version
|
| 6 | +* @package PHPMailer
|
| 7 | +* @author Ilias Bartolini <brain79@inwind.it>
|
| 8 | +*/
|
| 9 | +
|
| 10 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.';
|
| 11 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.';
|
| 12 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.';
|
| 13 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 14 | +$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: ';
|
| 15 | +$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: ';
|
| 16 | +$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: ';
|
| 17 | +$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: ';
|
| 18 | +$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: ';
|
| 19 | +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail';
|
| 20 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 21 | +$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente';
|
| 22 | +$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';
|
| 23 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: ';
|
| 24 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 25 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 26 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 27 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 28 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-it.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 29 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-cz.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Czech Version
|
| 6 | +*/
|
| 7 | +
|
| 8 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentikace.';
|
| 9 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nelze navázat spojení se SMTP serverem.';
|
| 10 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data nebyla pøijata';
|
| 11 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 12 | +$PHPMAILER_LANG['encoding'] = 'Neznámé kódování: ';
|
| 13 | +$PHPMAILER_LANG['execute'] = 'Nelze provést: ';
|
| 14 | +$PHPMAILER_LANG['file_access'] = 'Soubor nenalezen: ';
|
| 15 | +$PHPMAILER_LANG['file_open'] = 'File Error: Nelze otevøít soubor pro ètení: ';
|
| 16 | +$PHPMAILER_LANG['from_failed'] = 'Následující adresa From je nesprávná: ';
|
| 17 | +$PHPMAILER_LANG['instantiate'] = 'Nelze vytvoøit instanci emailové funkce.';
|
| 18 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 19 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailový klient není podporován.';
|
| 20 | +$PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoò jednu emailovou adresu pøíjemce.';
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy pøíjemcù nejsou správné ';
|
| 22 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 23 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 24 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 25 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 26 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-cz.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-no.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Norwegian Version
|
| 6 | +*/
|
| 7 | +
|
| 8 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Feil: Kunne ikke authentisere.';
|
| 9 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Feil: Kunne ikke koble til SMTP host.';
|
| 10 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Feil: Data ble ikke akseptert.';
|
| 11 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 12 | +$PHPMAILER_LANG['encoding'] = 'Ukjent encoding: ';
|
| 13 | +$PHPMAILER_LANG['execute'] = 'Kunne ikke utføre: ';
|
| 14 | +$PHPMAILER_LANG['file_access'] = 'Kunne ikke få tilgang til filen: ';
|
| 15 | +$PHPMAILER_LANG['file_open'] = 'Fil feil: Kunne ikke åpne filen: ';
|
| 16 | +$PHPMAILER_LANG['from_failed'] = 'Følgende Fra feilet: ';
|
| 17 | +$PHPMAILER_LANG['instantiate'] = 'Kunne ikke instantiate mail funksjonen.';
|
| 18 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 19 | +$PHPMAILER_LANG['provide_address'] = 'Du må ha med minst en mottager adresse.';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.';
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottagere feilet: ';
|
| 22 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 23 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 24 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 25 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 26 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-no.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ro.php |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Romanian Version
|
| 6 | +* @package PHPMailer
|
| 7 | +* @author Catalin Constantin <catalin@dazoot.ro>
|
| 8 | +*/
|
| 9 | +
|
| 10 | +$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.';
|
| 11 | +$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
|
| 12 | +$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
|
| 13 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 14 | +$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: ';
|
| 15 | +$PHPMAILER_LANG['execute'] = 'Nu pot executa: ';
|
| 16 | +$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: ';
|
| 17 | +$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: ';
|
| 18 | +$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: ';
|
| 19 | +$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.';
|
| 20 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 21 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
|
| 22 | +$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
|
| 23 | +$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
|
| 24 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 25 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 26 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 27 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 28 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ro.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 29 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-zh.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | +* PHPMailer language file: refer to English translation for definitive list |
| 5 | +* Traditional Chinese Version |
| 6 | +* @author liqwei <liqwei@liqwei.com> |
| 7 | +*/ |
| 8 | + |
| 9 | +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登錄失敗。'; |
| 10 | +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。'; |
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:數據不被接受。'; |
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; |
| 13 | +$PHPMAILER_LANG['encoding'] = '未知編碼: '; |
| 14 | +$PHPMAILER_LANG['file_access'] = '無法訪問文件:'; |
| 15 | +$PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:'; |
| 16 | +$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; |
| 17 | +$PHPMAILER_LANG['execute'] = '無法執行:'; |
| 18 | +$PHPMAILER_LANG['instantiate'] = '未知函數調用。'; |
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; |
| 20 | +$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; |
| 21 | +$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。'; |
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:收件人地址錯誤:'; |
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; |
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; |
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; |
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; |
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-zh.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ca.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Catalan Version
|
| 6 | +* By Ivan: web AT microstudi DOT com
|
| 7 | +*/
|
| 8 | +
|
| 9 | +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s\'hapogut autenticar.';
|
| 10 | +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.';
|
| 11 | +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.';
|
| 12 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 13 | +$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: ';
|
| 14 | +$PHPMAILER_LANG['execute'] = 'No es pot executar: ';
|
| 15 | +$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l\'arxiu: ';
|
| 16 | +$PHPMAILER_LANG['file_open'] = 'Error d\'Arxiu: No es pot obrir l\'arxiu: ';
|
| 17 | +$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: ';
|
| 18 | +$PHPMAILER_LANG['instantiate'] = 'No s\'ha pogut crear una instància de la funció Mail.';
|
| 19 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';
|
| 21 | +$PHPMAILER_LANG['provide_address'] = 'S\'ha de proveir almenys una adreça d\'email com a destinatari.';
|
| 22 | +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: ';
|
| 23 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 24 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 25 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 26 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 27 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ca.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 28 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-tr.php |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Turkish version
|
| 6 | +* Türkçe Versiyonu
|
| 7 | +* ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu
|
| 8 | +*/
|
| 9 | +
|
| 10 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Hatasý: Doðrulanamýyor.';
|
| 11 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Hatasý: SMTP hosta baðlanýlamýyor.';
|
| 12 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatasý: Veri kabul edilmedi.';
|
| 13 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 14 | +$PHPMAILER_LANG['encoding'] = 'Bilinmeyen þifreleme: ';
|
| 15 | +$PHPMAILER_LANG['execute'] = 'Çalýþtýrýlamýyor: ';
|
| 16 | +$PHPMAILER_LANG['file_access'] = 'Dosyaya eriþilemiyor: ';
|
| 17 | +$PHPMAILER_LANG['file_open'] = 'Dosya Hatasý: Dosya açýlamýyor: ';
|
| 18 | +$PHPMAILER_LANG['from_failed'] = 'Baþarýsýz olan gönderici adresi: ';
|
| 19 | +$PHPMAILER_LANG['instantiate'] = 'Örnek mail fonksiyonu yaratýlamadý.';
|
| 20 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 21 | +$PHPMAILER_LANG['provide_address'] = 'En az bir tane mail adresi belirtmek zorundasýnýz alýcýnýn email adresi.';
|
| 22 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailler desteklenmemektedir.';
|
| 23 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatasý: alýcýlara ulaþmadý: ';
|
| 24 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 25 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 26 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 27 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 28 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-tr.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 29 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ru.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* Russian Version by Alexey Chumakov <alex@chumakov.ru>
|
| 6 | +*/
|
| 7 | +
|
| 8 | +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.';
|
| 9 | +$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.';
|
| 10 | +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.';
|
| 11 | +//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
|
| 12 | +$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: ';
|
| 13 | +$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: ';
|
| 14 | +$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
|
| 15 | +$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: ';
|
| 16 | +$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
|
| 17 | +$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.';
|
| 18 | +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: ';
|
| 19 | +$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
|
| 20 | +$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.';
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: ';
|
| 22 | +//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
|
| 23 | +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
|
| 24 | +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
|
| 25 | +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
|
| 26 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-ru.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-de.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | +* PHPMailer language file: refer to English translation for definitive list
|
| 5 | +* German Version
|
| 6 | +*/
|
| 7 | +
|
| 8 | +$PHPMAILER_LANG['authenticate'] = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
|
| 9 | +$PHPMAILER_LANG['connect_host'] = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
|
| 10 | +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Fehler: Daten werden nicht akzeptiert.';
|
| 11 | +$PHPMAILER_LANG['empty_message'] = 'E-Mail Inhalt ist leer.';
|
| 12 | +$PHPMAILER_LANG['encoding'] = 'Unbekanntes Encoding-Format: ';
|
| 13 | +$PHPMAILER_LANG['execute'] = 'Konnte folgenden Befehl nicht ausführen: ';
|
| 14 | +$PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
|
| 15 | +$PHPMAILER_LANG['file_open'] = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';
|
| 16 | +$PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
|
| 17 | +$PHPMAILER_LANG['instantiate'] = 'Mail Funktion konnte nicht initialisiert werden.';
|
| 18 | +$PHPMAILER_LANG['invalid_email'] = 'E-Mail wird nicht gesendet, die Adresse ist ungültig.';
|
| 19 | +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
|
| 20 | +$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger E-Mailadresse an.';
|
| 21 | +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Fehler: Die folgenden Empfänger sind nicht korrekt: ';
|
| 22 | +$PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
|
| 23 | +$PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zu SMTP Server fehlgeschlagen.';
|
| 24 | +$PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP Server: ';
|
| 25 | +$PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: ';
|
| 26 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/language/phpmailer.lang-de.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 27 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/aboutus.html |
— | — | @@ -0,0 +1,169 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<style>
|
| 5 | +body, p, li, td {
|
| 6 | + font-family: Arial, Helvetica, sans-serif;
|
| 7 | + font-size: 12px;
|
| 8 | +}
|
| 9 | +ul {
|
| 10 | + margin:0 0px 0 15px;
|
| 11 | + padding:0;
|
| 12 | +}
|
| 13 | +div.width {
|
| 14 | + width: 760px;
|
| 15 | + text-align: left;
|
| 16 | +}
|
| 17 | +</style>
|
| 18 | +<script>
|
| 19 | +<!--
|
| 20 | +var popsite="http://phpmailer.codeworxtech.com"
|
| 21 | +var withfeatures="width=960,height=760,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"
|
| 22 | +var once_per_session=0
|
| 23 | +function get_cookie(Name) {
|
| 24 | + var search = Name + "="
|
| 25 | + var returnvalue = "";
|
| 26 | + if (document.cookie.length > 0) {
|
| 27 | + offset = document.cookie.indexOf(search)
|
| 28 | + if (offset != -1) { // if cookie exists
|
| 29 | + offset += search.length
|
| 30 | + // set index of beginning of value
|
| 31 | + end = document.cookie.indexOf(";", offset);
|
| 32 | + // set index of end of cookie value
|
| 33 | + if (end == -1)
|
| 34 | + end = document.cookie.length;
|
| 35 | + returnvalue=unescape(document.cookie.substring(offset, end))
|
| 36 | + }
|
| 37 | + }
|
| 38 | + return returnvalue;
|
| 39 | +}
|
| 40 | +function loadornot(){
|
| 41 | + if (get_cookie('popsite')=='') {
|
| 42 | + loadpopsite()
|
| 43 | + document.cookie="popsite=yes"
|
| 44 | + }
|
| 45 | +}
|
| 46 | +function loadpopsite(){
|
| 47 | + win2=window.open(popsite,"",withfeatures)
|
| 48 | + win2.blur()
|
| 49 | + window.focus()
|
| 50 | +}
|
| 51 | +if (once_per_session==0) {
|
| 52 | + loadpopsite()
|
| 53 | +} else {
|
| 54 | + loadornot()
|
| 55 | +}
|
| 56 | +-->
|
| 57 | +</script>
|
| 58 | +</head>
|
| 59 | +<body>
|
| 60 | +<center>
|
| 61 | +<div class="width">
|
| 62 | +<hr>
|
| 63 | +The http://phpmailer.codeworxtech.com/ website now carries a few
|
| 64 | +advertisements through the Google Adsense network to help offset
|
| 65 | +some of our costs.<br />
|
| 66 | +Thanks ....<br />
|
| 67 | +<hr>
|
| 68 | +<p>PHPMailer is the world's leading email transport class and downloaded an
|
| 69 | +average of more than 32,000 each month. In March 2009, PHPMailer was downloaded
|
| 70 | +more than 31,000 times -- that's an average of 1,000 downloads daily. Our thanks
|
| 71 | +to our new users and loyal users. We understand you have many choices available
|
| 72 | +to select from and we thank you for select our fast and stable tool for your
|
| 73 | +website and projects.</p>
|
| 74 | +<p>Credits:<br>
|
| 75 | +PHPMailer's original founder is Brent Matzelle. The current team is:<br>
|
| 76 | +Project Administrator: Andy Prevost (codeworxtech),
|
| 77 | +<a href="mailto:codeworxtech@users.sourceforge.net">
|
| 78 | +codeworxtech@users.sourceforge.net</a><br>
|
| 79 | +Author: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net<br>
|
| 80 | +Author: Marcus Bointon (coolbru) <a href="mailto:coolbru@users.sourceforge.net">
|
| 81 | +coolbru@users.sourceforge.net</a></p>
|
| 82 | +<p>PHPMailer is used in many projects ranging from Open Source to commercial
|
| 83 | +packages. Our LGPL licensing terms are very flexible and allow for including
|
| 84 | +PHPMailer to enhance projects of all types. If you discover PHPMailer being used
|
| 85 | +in a project, please let us know about it.</p>
|
| 86 | +<p><strong>WHY USE OUR TOOLS & WHAT'S IN IT FOR YOU?</strong></p>
|
| 87 | +<p>A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.</p>
|
| 88 | +<p>Now, here's our team:</p>
|
| 89 | +<table width="100%" cellpadding="5" style="border-collapse: collapse" border="1">
|
| 90 | + <tr>
|
| 91 | + <th><b>About Andy Prevost, AKA "codeworxtech".</b></th>
|
| 92 | + <th><b>About Marcus Bointon, AKA "coolbru".</b></th>
|
| 93 | + </tr>
|
| 94 | + <tr>
|
| 95 | + <td width="50%" valign="top">
|
| 96 | + <p><a href="http://www.codeworxtech.com">www.codeworxtech.com</a> for more information.<br>
|
| 97 | + Web design, web applications, forms: <a href="http://www.worxstudio.com">WorxStudio.com</a><br />
|
| 98 | + </p>
|
| 99 | + <p>Our company, <strong>Worx International Inc.</strong>, is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin and QuickCache) and now PHPMailer.
|
| 100 | + We have staff and offices in the United States, Caribbean, the Middle
|
| 101 | + East, and our primary development center in Canada. Our company is represented by
|
| 102 | + agents and resellers globally.</p>
|
| 103 | + <p><strong>Worx International Inc.</strong> is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While <strong>Worx International Inc.</strong> can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we're the team to get it done right at a reasonable price.</p>
|
| 104 | + <p>Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.</p>
|
| 105 | + <p>Our developer tools are all Open Source. Here's a brief description:</p>
|
| 106 | + <ul>
|
| 107 | + <li><span style="background-color: #FFFF00"><strong>PHPMailer</strong></span>. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than
|
| 108 | + 26000 times each and every month by developers looking for a fast, stable, simple email solution. We used it ourselves for years as our favorite tool. It's always been small (the entire footprint is
|
| 109 | + less than 100 Kb), stable, and as complete a solution as you can find.
|
| 110 | + Other tools are nowhere near as simple. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at
|
| 111 | + <a href="http://phpmailer.codeworxtech.com/">http://phpmailer.codeworxtech.com/</a>. <br />
|
| 112 | + Please note: <strong>all of our focus is now on the PHPMailer for PHP5.</strong><br />
|
| 113 | + <span style="background-color: #FFFF00">PS. While you are at it, please visit our sponsor's sites, click on their ads.
|
| 114 | + It helps offset some of our costs.</span><br />
|
| 115 | + Want to help? We're looking for progressive developers to join our team of volunteer professionals working on PHPMailer. Our entire focus is on PHPMailer
|
| 116 | + for PHP5. If you are interested, let us know.<br />
|
| 117 | + <br />
|
| 118 | + </li>
|
| 119 | + <li><strong><span style="background-color: #FFFF00">QuickCache</span></strong>. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at
|
| 120 | + <a href="http://quickcache.codeworxtech.com/">http://quickcache.codeworxtech.com/</a>.<br />
|
| 121 | + <br />
|
| 122 | + </li>
|
| 123 | + <li><strong><span style="background-color: #FFFF00">QuickSkin</span></strong>. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It's a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at
|
| 124 | + <a href="http://quickskin.codeworxtech.com/">http://quickskin.codeworxtech.com/</a>.<br />
|
| 125 | + <br />
|
| 126 | + </li>
|
| 127 | + </ul>
|
| 128 | + <p>We're committed to PHP and to the Open Source community.</p>
|
| 129 | + <p>Opportunities with <strong>Worx International Inc.</strong>:</p>
|
| 130 | + <ul>
|
| 131 | + <li><span style="background-color: #FFFF00">Resellers/Agents</span>: We're always interested in talking with companies that
|
| 132 | + want to represent
|
| 133 | + <strong>Worx International Inc.</strong> in their markets. We also have private label programs for our commercial products (in certain circumstances).</li>
|
| 134 | + <li>Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with
|
| 135 | + <strong>Worx International Inc.</strong>, we would be pleased to hear from you.<br />
|
| 136 | + A few things to note:<br />
|
| 137 | + <ul>
|
| 138 | + <li>experience level does not matter: from fresh out of college to multi-year experience - it's your
|
| 139 | + creative mind and a positive attitude we want</li>
|
| 140 | + <li>if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation</li>
|
| 141 | + <li>if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.</li>
|
| 142 | + <li>any contact that ignores any of these points will be discarded</li>
|
| 143 | + </ul></li>
|
| 144 | + <li>Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let's talk.</li>
|
| 145 | + </ul>
|
| 146 | + Regards,<br />
|
| 147 | + Andy Prevost (aka, codeworxtech)<br />
|
| 148 | + <a href="mailto:codeworxtech@users.sourceforge.net">codeworxtech@users.sourceforge.net</a><br />
|
| 149 | + <br />
|
| 150 | + We now also offer website design. hosting, and remote forms processing. Visit <a href="http://www.worxstudio.com/" target="_blank">WorxStudio.com</a> for more information.<br />
|
| 151 | + </td>
|
| 152 | + <td width="50%" valign="top">
|
| 153 | + <p>Marcus is the technical director of <a href="http://www.synchromedia.co.uk/">Synchromedia Limited</a>, a UK-based company providing online business services. Synchromedia's main services are:</p>
|
| 154 | + <h2>Smartmessages.net</h2>
|
| 155 | + <p><a href="https://www.smartmessages.net/"><img src="http://www.synchromedia.co.uk/uploads/images/smlogo.gif" width="292" height="48" alt="Smartmessages.net logo" /><br />Smartmessages.net</a> is Synchromedia's large-scale mailing list management system, providing email delivery services for a wide range of businesses, from sole traders to corporates.
|
| 156 | + We pride ourselves on personal service, and realise that every one of your subscribers is a precious asset to be handled with care.
|
| 157 | + We provide fast, reliable, high-volume delivery (some of our customers have lists of more than 1,000,000 subscribers) with fine-grained tracking while ensuring you stay fully compliant with UK, EC and US data protection laws. Smartmessages of course uses PHPMailer at its heart!</p>
|
| 158 | + <h2>info@hand</h2>
|
| 159 | + <p><a href="http://www.synchromedia.co.uk/what-we-do/info-at-hand-crm/"><img src="http://www.synchromedia.co.uk/uploads/images/infoathand-large.png" width="250" height="40" alt="info@hand logo" /></a><br />Synchromedia is the official UK distributor of <a href="http://www.thelongreach.com/">info@hand</a>, a class-leading open-source web-based CRM system. We provide licenses, hosting, planning, support and training for this very fully-featured system at very competitive prices. info@hand also uses PHPMailer!</p>
|
| 160 | + <h2>How can we help you?</h2>
|
| 161 | + <p>In addition to our headline services, we also provide consulting, development, hosting and sysadmin services, so if you just need a simple web hosting package, we can do that too. Not surprisingly, we know rather a lot about email, so you can talk to us about that too.</p>
|
| 162 | + <p>Please <a href="http://www.synchromedia.co.uk/about-us/contact-us/">contact us</a> if you'd like to know more.</p>
|
| 163 | + <p>Marcus is a regular attendee at <a href="http://www.phplondon.org/">PHP London</a>, and occasionally speaks on email at technical conferences.</p>
|
| 164 | + </td>
|
| 165 | + </tr>
|
| 166 | +</table>
|
| 167 | +</div>
|
| 168 | +</center>
|
| 169 | +</body>
|
| 170 | +</html> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/aboutus.html |
___________________________________________________________________ |
Added: svn:executable |
1 | 171 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/changelog.txt |
— | — | @@ -0,0 +1,408 @@ |
| 2 | +ChangeLog
|
| 3 | +
|
| 4 | +NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6.
|
| 5 | + IT WILL NOT WORK WITH PHP4.
|
| 6 | +
|
| 7 | +Version 5.1 (October 20, 2009)
|
| 8 | +* fixed filename issue with AddStringAttachment (thanks to Tony)
|
| 9 | +* fixed "SingleTo" property, now works with Senmail, Qmail, and SMTP in
|
| 10 | + addition to PHP mail()
|
| 11 | +* added DKIM digital signing functionality
|
| 12 | + New properties:
|
| 13 | + - DKIM_domain (sets the domain name)
|
| 14 | + - DKIM_private (holds DKIM private key)
|
| 15 | + - DKIM_passphrase (holds your DKIM passphrase)
|
| 16 | + - DKIM_selector (holds the DKIM "selector")
|
| 17 | + - DKIM_identity (holds the identifying email address)
|
| 18 | +* added callback function support
|
| 19 | + - callback function parameters include:
|
| 20 | + result, to, cc, bcc, subject and body
|
| 21 | + * see the test/test_callback.php file for usage.
|
| 22 | +* added "auto" identity functionality
|
| 23 | + - can automatically add:
|
| 24 | + - Return-path (if Sender not set)
|
| 25 | + - Reply-To (if ReplyTo not set)
|
| 26 | + - can be disabled:
|
| 27 | + - $mail->SetFrom('yourname@yourdomain.com','First Last',false);
|
| 28 | + - or by adding the $mail->Sender and/or $mail->ReplyTo properties
|
| 29 | + Note: "auto" identity added to help with emails ending up in spam
|
| 30 | + or junk boxes because of missing headers
|
| 31 | +
|
| 32 | +Version 5.0.2 (May 24, 2009)
|
| 33 | +* Fix for missing attachments when inline graphics are present
|
| 34 | +* Fix for missing Cc in header when using SMTP (mail was sent,
|
| 35 | + but not displayed in header -- Cc receiver only saw email To:
|
| 36 | + line and no Cc line, but did get the email (To receiver
|
| 37 | + saw same)
|
| 38 | +
|
| 39 | +Version 5.0.1 (April 05, 2009)
|
| 40 | +* Temporary fix for missing attachments
|
| 41 | +
|
| 42 | +Version 5.0.0 (April 02, 2009)
|
| 43 | +
|
| 44 | +* With the release of this version, we are initiating a new version numbering
|
| 45 | + system to differentiate from the PHP4 version of PHPMailer.
|
| 46 | +* Most notable in this release is fully object oriented code.
|
| 47 | +class.smtp.php:
|
| 48 | +* Refactored class.smtp.php to support new exception handling
|
| 49 | + code size reduced from 29.2 Kb to 25.6 Kb
|
| 50 | +* Removed unnecessary functions from class.smtp.php:
|
| 51 | + public function Expand($name) {
|
| 52 | + public function Help($keyword="") {
|
| 53 | + public function Noop() {
|
| 54 | + public function Send($from) {
|
| 55 | + public function SendOrMail($from) {
|
| 56 | + public function Verify($name) {
|
| 57 | +class.phpmailer.php:
|
| 58 | +* Refactored class.phpmailer.php with new exception handling
|
| 59 | +* Changed processing functionality of Sendmail and Qmail so they cannot be
|
| 60 | + inadvertently used
|
| 61 | +* removed getFile() function, just became a simple wrapper for
|
| 62 | + file_get_contents()
|
| 63 | +* added check for PHP version (will gracefully exit if not at least PHP 5.0)
|
| 64 | +class.phpmailer.php enhancements
|
| 65 | +* enhanced code to check if an attachment source is the same as an embedded or
|
| 66 | + inline graphic source to eliminate duplicate attachments
|
| 67 | +New /test_script
|
| 68 | +* We have written a test script you can use to test the script as part of your
|
| 69 | + installation. Once you press submit, the test script will send a multi-mime
|
| 70 | + email with either the message you type in or an HTML email with an inline
|
| 71 | + graphic. Two attachments are included in the email (one of the attachments
|
| 72 | + is also the inline graphic so you can see that only one copy of the graphic
|
| 73 | + is sent in the email). The test script will also display the functional
|
| 74 | + script that you can copy/paste to your editor to duplicate the functionality.
|
| 75 | +New examples
|
| 76 | +* All new examples in both basic and advanced modes. Advanced examples show
|
| 77 | + Exception handling.
|
| 78 | +PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0
|
| 79 | +* all new documentation
|
| 80 | +
|
| 81 | +Please note: the website has been updated to reflect the changes in PHPMailer
|
| 82 | +version 5.0.0. http://phpmailer.codeworxtech.com/
|
| 83 | +
|
| 84 | +Version 2.3 (November 06, 2008)
|
| 85 | +
|
| 86 | +* added Arabic language (many thanks to Bahjat Al Mostafa)
|
| 87 | +* removed English language from language files and made it a default within
|
| 88 | + class.phpmailer.php - if no language is found, it will default to use
|
| 89 | + the english language translation
|
| 90 | +* fixed public/private declarations
|
| 91 | +* corrected line 1728, $basedir to $directory
|
| 92 | +* added $sign_cert_file to avoid improper duplicate use of $sign_key_file
|
| 93 | +* corrected $this->Hello on line 612 to $this->Helo
|
| 94 | +* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user
|
| 95 | + if default is not acceptable
|
| 96 | +* removed trim() from return results in EncodeQP
|
| 97 | +* /test and three files it contained are removed from version 2.3
|
| 98 | +* fixed phpunit.php for compliance with PHP5
|
| 99 | +* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg);
|
| 100 | +* We have removed the /phpdoc from the downloads. All documentation is now on
|
| 101 | + the http://phpmailer.codeworxtech.com website.
|
| 102 | +
|
| 103 | +Version 2.2.1 () July 19 2008
|
| 104 | +
|
| 105 | +* fixed line 1092 in class.smtp.php (my apologies, error on my part)
|
| 106 | +
|
| 107 | +Version 2.2 () July 15 2008
|
| 108 | +
|
| 109 | +* Fixed redirect issue (display of UTF-8 in thank you redirect)
|
| 110 | +* fixed error in getResponse function declaration (class.pop3.php)
|
| 111 | +* PHPMailer now PHP6 compliant
|
| 112 | +* fixed line 1092 in class.smtp.php (endless loop from missing = sign)
|
| 113 | +
|
| 114 | +Version 2.1 (Wed, June 04 2008)
|
| 115 | +
|
| 116 | +** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.
|
| 117 | + IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE
|
| 118 | + APPRECIATED.
|
| 119 | +
|
| 120 | +* added S/MIME functionality (ability to digitally sign emails)
|
| 121 | + BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
|
| 122 | + The "Signed Emails" functionality adds the Sign method to pass the private key
|
| 123 | + filename and the password to read it, and then email will be sent with
|
| 124 | + content-type multipart/signed and with the digital signature attached.
|
| 125 | +* fully compatible with E_STRICT error level
|
| 126 | + - Please note:
|
| 127 | + In about half the test environments this development version was subjected
|
| 128 | + to, an error was thrown for the date() functions used (line 1565 and 1569).
|
| 129 | + This is NOT a PHPMailer error, it is the result of an incorrectly configured
|
| 130 | + PHP5 installation. The fix is to modify your 'php.ini' file and include the
|
| 131 | + date.timezone = America/New York
|
| 132 | + directive, to your own server timezone
|
| 133 | + - If you do get this error, and are unable to access your php.ini file:
|
| 134 | + In your PHP script, add
|
| 135 | + date_default_timezone_set('America/Toronto');
|
| 136 | + - do not try to use
|
| 137 | + $myVar = date_default_timezone_get();
|
| 138 | + as a test, it will throw an error.
|
| 139 | +* added ability to define path (mainly for embedded images)
|
| 140 | + function MsgHTML($message,$basedir='') ... where:
|
| 141 | + $basedir is the fully qualified path
|
| 142 | +* fixed MsgHTML() function:
|
| 143 | + - Embedded Images where images are specified by <protocol>:// will not be altered or embedded
|
| 144 | +* fixed the return value of SMTP exit code ( pclose )
|
| 145 | +* addressed issue of multibyte characters in subject line and truncating
|
| 146 | +* added ability to have user specified Message ID
|
| 147 | + (default is still that PHPMailer create a unique Message ID)
|
| 148 | +* corrected unidentified message type to 'application/octet-stream'
|
| 149 | +* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al).
|
| 150 | +* added check for added attachments
|
| 151 | +* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny")
|
| 152 | +
|
| 153 | +Version 2.1.0beta2 (Sun, Dec 02 2007)
|
| 154 | +* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon)
|
| 155 | +* finished all testing, all known bugs corrected, enhancements tested
|
| 156 | +- note: will NOT work with PHP4.
|
| 157 | +
|
| 158 | +please note, this is BETA software
|
| 159 | +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS
|
| 160 | +INTENDED STRICTLY FOR TESTING
|
| 161 | +
|
| 162 | +Version 2.1.0beta1
|
| 163 | +please note, this is BETA software
|
| 164 | +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS
|
| 165 | +INTENDED STRICTLY FOR TESTING
|
| 166 | +
|
| 167 | +Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release
|
| 168 | +* implements new property to control VERP in class.smtp.php
|
| 169 | + example (requires instantiating class.smtp.php):
|
| 170 | + $mail->do_verp = true;
|
| 171 | +* POP-before-SMTP functionality included, thanks to Richard Davey
|
| 172 | + (see class.pop3.php & pop3_before_smtp_test.php for examples)
|
| 173 | +* included example showing how to use PHPMailer with GMAIL
|
| 174 | +* fixed the missing Cc in SendMail() and Mail()
|
| 175 | +
|
| 176 | +******************
|
| 177 | +A note on sending bulk emails:
|
| 178 | +
|
| 179 | +If the email you are sending is not personalized, consider using the
|
| 180 | +"undisclosed-recipient:;" strategy. That is, put all of your recipients
|
| 181 | +in the Bcc field and set the To field to "undisclosed-recipients:;".
|
| 182 | +It's a lot faster (only one send) and saves quite a bit on resources.
|
| 183 | +Contrary to some opinions, this will not get you listed in spam engines -
|
| 184 | +it's a legitimate way for you to send emails.
|
| 185 | +
|
| 186 | +A partial example for use with PHPMailer:
|
| 187 | +
|
| 188 | +$mail->AddAddress("undisclosed-recipients:;");
|
| 189 | +$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com");
|
| 190 | +
|
| 191 | +Many email service providers restrict the number of emails that can be sent
|
| 192 | +in any given time period. Often that is between 50 - 60 emails maximum
|
| 193 | +per hour or per send session.
|
| 194 | +
|
| 195 | +If that's the case, then break up your Bcc lists into chunks that are one
|
| 196 | +less than your limit, and put a pause in your script.
|
| 197 | +*******************
|
| 198 | +
|
| 199 | +Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release
|
| 200 | +* dramatically simplified using inline graphics ... it's fully automated and requires no user input
|
| 201 | +* added automatic document type detection for attachments and pictures
|
| 202 | +* added MsgHTML() function to replace Body tag for HTML emails
|
| 203 | +* fixed the SendMail security issues (input validation vulnerability)
|
| 204 | +* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address
|
| 205 | +* removed the need to use the AltBody method (set from the HTML, or default text used)
|
| 206 | +* set the PHP Mail() function as the default (still support SendMail, SMTP Mail)
|
| 207 | +* removed the need to set the IsHTML property (set automatically)
|
| 208 | +* added Estonian language file by Indrek Päri
|
| 209 | +* added header injection patch
|
| 210 | +* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc.
|
| 211 | + example of use:
|
| 212 | + $mail->set('X-Priority', '3');
|
| 213 | + $mail->set('X-MSMail-Priority', 'Normal');
|
| 214 | +* fixed warning message in SMTP get_lines method
|
| 215 | +* added TLS/SSL SMTP support
|
| 216 | + example of use:
|
| 217 | + $mail = new PHPMailer();
|
| 218 | + $mail->Mailer = "smtp";
|
| 219 | + $mail->Host = "smtp.example.com";
|
| 220 | + $mail->SMTPSecure = "tls"; // option
|
| 221 | + //$mail->SMTPSecure = "ssl"; // option
|
| 222 | + ...
|
| 223 | + $mail->Send();
|
| 224 | +* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7)
|
| 225 | +* Works with PHP installed as a module or as CGI-PHP
|
| 226 | +- NOTE: will NOT work with PHP5 in E_STRICT error mode
|
| 227 | +
|
| 228 | +Version 1.73 (Sun, Jun 10 2005)
|
| 229 | +* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
|
| 230 | +* Now has a total of 20 translations
|
| 231 | +* Fixed alt attachments bug: http://tinyurl.com/98u9k
|
| 232 | +
|
| 233 | +Version 1.72 (Wed, May 25 2004)
|
| 234 | +* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations.
|
| 235 | +* Received: Removed this method because spam filter programs like
|
| 236 | +SpamAssassin reject this header.
|
| 237 | +* Fixed error count bug.
|
| 238 | +* SetLanguage default is now "language/".
|
| 239 | +* Fixed magic_quotes_runtime bug.
|
| 240 | +
|
| 241 | +Version 1.71 (Tue, Jul 28 2003)
|
| 242 | +* Made several speed enhancements
|
| 243 | +* Added German and Italian translation files
|
| 244 | +* Fixed HELO/AUTH bugs on keep-alive connects
|
| 245 | +* Now provides an error message if language file does not load
|
| 246 | +* Fixed attachment EOL bug
|
| 247 | +* Updated some unclear documentation
|
| 248 | +* Added additional tests and improved others
|
| 249 | +
|
| 250 | +Version 1.70 (Mon, Jun 20 2003)
|
| 251 | +* Added SMTP keep-alive support
|
| 252 | +* Added IsError method for error detection
|
| 253 | +* Added error message translation support (SetLanguage)
|
| 254 | +* Refactored many methods to increase library performance
|
| 255 | +* Hello now sends the newer EHLO message before HELO as per RFC 2821
|
| 256 | +* Removed the boundary class and replaced it with GetBoundary
|
| 257 | +* Removed queue support methods
|
| 258 | +* New $Hostname variable
|
| 259 | +* New Message-ID header
|
| 260 | +* Received header reformat
|
| 261 | +* Helo variable default changed to $Hostname
|
| 262 | +* Removed extra spaces in Content-Type definition (#667182)
|
| 263 | +* Return-Path should be set to Sender when set
|
| 264 | +* Adds Q or B encoding to headers when necessary
|
| 265 | +* quoted-encoding should now encode NULs \000
|
| 266 | +* Fixed encoding of body/AltBody (#553370)
|
| 267 | +* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC)
|
| 268 | +* Multiple bug fixes
|
| 269 | +
|
| 270 | +Version 1.65 (Fri, Aug 09 2002)
|
| 271 | +* Fixed non-visible attachment bug (#585097) for Outlook
|
| 272 | +* SMTP connections are now closed after each transaction
|
| 273 | +* Fixed SMTP::Expand return value
|
| 274 | +* Converted SMTP class documentation to phpDocumentor format
|
| 275 | +
|
| 276 | +Version 1.62 (Wed, Jun 26 2002)
|
| 277 | +* Fixed multi-attach bug
|
| 278 | +* Set proper word wrapping
|
| 279 | +* Reduced memory use with attachments
|
| 280 | +* Added more debugging
|
| 281 | +* Changed documentation to phpDocumentor format
|
| 282 | +
|
| 283 | +Version 1.60 (Sat, Mar 30 2002)
|
| 284 | +* Sendmail pipe and address patch (Christian Holtje)
|
| 285 | +* Added embedded image and read confirmation support (A. Ognio)
|
| 286 | +* Added unit tests
|
| 287 | +* Added SMTP timeout support (*nix only)
|
| 288 | +* Added possibly temporary PluginDir variable for SMTP class
|
| 289 | +* Added LE message line ending variable
|
| 290 | +* Refactored boundary and attachment code
|
| 291 | +* Eliminated SMTP class warnings
|
| 292 | +* Added SendToQueue method for future queuing support
|
| 293 | +
|
| 294 | +Version 1.54 (Wed, Dec 19 2001)
|
| 295 | +* Add some queuing support code
|
| 296 | +* Fixed a pesky multi/alt bug
|
| 297 | +* Messages are no longer forced to have "To" addresses
|
| 298 | +
|
| 299 | +Version 1.50 (Thu, Nov 08 2001)
|
| 300 | +* Fix extra lines when not using SMTP mailer
|
| 301 | +* Set WordWrap variable to int with a zero default
|
| 302 | +
|
| 303 | +Version 1.47 (Tue, Oct 16 2001)
|
| 304 | +* Fixed Received header code format
|
| 305 | +* Fixed AltBody order error
|
| 306 | +* Fixed alternate port warning
|
| 307 | +
|
| 308 | +Version 1.45 (Tue, Sep 25 2001)
|
| 309 | +* Added enhanced SMTP debug support
|
| 310 | +* Added support for multiple ports on SMTP
|
| 311 | +* Added Received header for tracing
|
| 312 | +* Fixed AddStringAttachment encoding
|
| 313 | +* Fixed possible header name quote bug
|
| 314 | +* Fixed wordwrap() trim bug
|
| 315 | +* Couple other small bug fixes
|
| 316 | +
|
| 317 | +Version 1.41 (Wed, Aug 22 2001)
|
| 318 | +* Fixed AltBody bug w/o attachments
|
| 319 | +* Fixed rfc_date() for certain mail servers
|
| 320 | +
|
| 321 | +Version 1.40 (Sun, Aug 12 2001)
|
| 322 | +* Added multipart/alternative support (AltBody)
|
| 323 | +* Documentation update
|
| 324 | +* Fixed bug in Mercury MTA
|
| 325 | +
|
| 326 | +Version 1.29 (Fri, Aug 03 2001)
|
| 327 | +* Added AddStringAttachment() method
|
| 328 | +* Added SMTP authentication support
|
| 329 | +
|
| 330 | +Version 1.28 (Mon, Jul 30 2001)
|
| 331 | +* Fixed a typo in SMTP class
|
| 332 | +* Fixed header issue with Imail (win32) SMTP server
|
| 333 | +* Made fopen() calls for attachments use "rb" to fix win32 error
|
| 334 | +
|
| 335 | +Version 1.25 (Mon, Jul 02 2001)
|
| 336 | +* Added RFC 822 date fix (Patrice)
|
| 337 | +* Added improved error handling by adding a $ErrorInfo variable
|
| 338 | +* Removed MailerDebug variable (obsolete with new error handler)
|
| 339 | +
|
| 340 | +Version 1.20 (Mon, Jun 25 2001)
|
| 341 | +* Added quoted-printable encoding (Patrice)
|
| 342 | +* Set Version as public and removed PrintVersion()
|
| 343 | +* Changed phpdoc to only display public variables and methods
|
| 344 | +
|
| 345 | +Version 1.19 (Thu, Jun 21 2001)
|
| 346 | +* Fixed MS Mail header bug
|
| 347 | +* Added fix for Bcc problem with mail(). *Does not work on Win32*
|
| 348 | + (See PHP bug report: http://www.php.net/bugs.php?id=11616)
|
| 349 | +* mail() no longer passes a fifth parameter when not needed
|
| 350 | +
|
| 351 | +Version 1.15 (Fri, Jun 15 2001)
|
| 352 | +[Note: these changes contributed by Patrice Fournier]
|
| 353 | +* Changed all remaining \n to \r\n
|
| 354 | +* Bcc: header no longer writen to message except
|
| 355 | +when sent directly to sendmail
|
| 356 | +* Added a small message to non-MIME compliant mail reader
|
| 357 | +* Added Sender variable to change the Sender email
|
| 358 | +used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode
|
| 359 | +* Changed boundary setting to a place it will be set only once
|
| 360 | +* Removed transfer encoding for whole message when using multipart
|
| 361 | +* Message body now uses Encoding in multipart messages
|
| 362 | +* Can set encoding and type to attachments 7bit, 8bit
|
| 363 | +and binary attachment are sent as is, base64 are encoded
|
| 364 | +* Can set Encoding to base64 to send 8 bits body
|
| 365 | +through 7 bits servers
|
| 366 | +
|
| 367 | +Version 1.10 (Tue, Jun 12 2001)
|
| 368 | +* Fixed win32 mail header bug (printed out headers in message body)
|
| 369 | +
|
| 370 | +Version 1.09 (Fri, Jun 08 2001)
|
| 371 | +* Changed date header to work with Netscape mail programs
|
| 372 | +* Altered phpdoc documentation
|
| 373 | +
|
| 374 | +Version 1.08 (Tue, Jun 05 2001)
|
| 375 | +* Added enhanced error-checking
|
| 376 | +* Added phpdoc documentation to source
|
| 377 | +
|
| 378 | +Version 1.06 (Fri, Jun 01 2001)
|
| 379 | +* Added optional name for file attachments
|
| 380 | +
|
| 381 | +Version 1.05 (Tue, May 29 2001)
|
| 382 | +* Code cleanup
|
| 383 | +* Eliminated sendmail header warning message
|
| 384 | +* Fixed possible SMTP error
|
| 385 | +
|
| 386 | +Version 1.03 (Thu, May 24 2001)
|
| 387 | +* Fixed problem where qmail sends out duplicate messages
|
| 388 | +
|
| 389 | +Version 1.02 (Wed, May 23 2001)
|
| 390 | +* Added multiple recipient and attachment Clear* methods
|
| 391 | +* Added Sendmail public variable
|
| 392 | +* Fixed problem with loading SMTP library multiple times
|
| 393 | +
|
| 394 | +Version 0.98 (Tue, May 22 2001)
|
| 395 | +* Fixed problem with redundant mail hosts sending out multiple messages
|
| 396 | +* Added additional error handler code
|
| 397 | +* Added AddCustomHeader() function
|
| 398 | +* Added support for Microsoft mail client headers (affects priority)
|
| 399 | +* Fixed small bug with Mailer variable
|
| 400 | +* Added PrintVersion() function
|
| 401 | +
|
| 402 | +Version 0.92 (Tue, May 15 2001)
|
| 403 | +* Changed file names to class.phpmailer.php and class.smtp.php to match
|
| 404 | + current PHP class trend.
|
| 405 | +* Fixed problem where body not being printed when a message is attached
|
| 406 | +* Several small bug fixes
|
| 407 | +
|
| 408 | +Version 0.90 (Tue, April 17 2001)
|
| 409 | +* Intial public release
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/changelog.txt |
___________________________________________________________________ |
Added: svn:executable |
1 | 410 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/pop3_article.txt |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +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.
|
| 3 | +
|
| 4 | +With that noted, here is how to implement it:
|
| 5 | +Install the class file
|
| 6 | +
|
| 7 | +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-1.72 directory:
|
| 8 | +[geshi lang=php] require 'phpmailer-1.72/class.phpmailer.php'; require 'phpmailer-1.72/class.pop3.php'; [/geshi]
|
| 9 | +When you need it, create your POP3 object
|
| 10 | +
|
| 11 | +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:
|
| 12 | +[geshi lang=php] Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1); $mail = new PHPMailer(); $mail->SMTPDebug = 2; $mail->IsSMTP(); $mail->IsHTML(false); $mail->Host = 'relay.example.com'; $mail->From = 'mailer@example.com'; $mail->FromName = 'Example Mailer'; $mail->Subject = 'My subject'; $mail->Body = 'Hello world'; $mail->AddAddress('rich@corephp.co.uk', 'Richard Davey'); if (!$mail->Send()) { echo $mail->ErrorInfo; } ?> [/geshi]
|
| 13 | +
|
| 14 | +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.
|
| 15 | +The Parameters
|
| 16 | +
|
| 17 | +The Authorise parameters are as follows:
|
| 18 | +[geshi lang=php]$pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);[/geshi]
|
| 19 | +
|
| 20 | + 1. pop3.example.com - The POP3 Mail Server Name (hostname or IP address)
|
| 21 | + 2. 110 - The POP3 Port on which to connect (default is usually 110, but check with your host)
|
| 22 | + 3. 30 - A connection time-out value (in seconds)
|
| 23 | + 4. mailer - The POP3 Username required to logon
|
| 24 | + 5. password - The POP3 Password required to logon
|
| 25 | + 6. 1 - The class debug level (0 = off, 1+ = debug output is echoed to the browser)
|
| 26 | +
|
| 27 | +Final Comments + the Download
|
| 28 | +
|
| 29 | +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.
|
| 30 | +
|
| 31 | +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.
|
| 32 | +
|
| 33 | +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.
|
| 34 | +
|
| 35 | +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.
|
| 36 | +Download
|
| 37 | +
|
| 38 | +Here is the full class file plus my test script: POP_before_SMTP_PHPMailer.zip (4 KB) - Please note that it does not include PHPMailer itself.
|
| 39 | +
|
| 40 | +My thanks to Chris Ryan for the inspiration (even if indirectly, via his SMTP class)
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/pop3_article.txt |
___________________________________________________________________ |
Added: svn:executable |
1 | 41 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/use_gmail.txt |
— | — | @@ -0,0 +1,45 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +// example on using PHPMailer with GMAIL
|
| 5 | +
|
| 6 | +include("class.phpmailer.php");
|
| 7 | +include("class.smtp.php"); // note, this is optional - gets called from main class if not already loaded
|
| 8 | +
|
| 9 | +$mail = new PHPMailer();
|
| 10 | +
|
| 11 | +$body = $mail->getFile('contents.html');
|
| 12 | +$body = eregi_replace("[\]",'',$body);
|
| 13 | +
|
| 14 | +$mail->IsSMTP();
|
| 15 | +$mail->SMTPAuth = true; // enable SMTP authentication
|
| 16 | +$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
|
| 17 | +$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
|
| 18 | +$mail->Port = 465; // set the SMTP port
|
| 19 | +
|
| 20 | +$mail->Username = "yourname@gmail.com"; // GMAIL username
|
| 21 | +$mail->Password = "password"; // GMAIL password
|
| 22 | +
|
| 23 | +$mail->From = "replyto@yourdomain.com";
|
| 24 | +$mail->FromName = "Webmaster";
|
| 25 | +$mail->Subject = "This is the subject";
|
| 26 | +$mail->AltBody = "This is the body when user views in plain text format"; //Text Body
|
| 27 | +$mail->WordWrap = 50; // set word wrap
|
| 28 | +
|
| 29 | +$mail->MsgHTML($body);
|
| 30 | +
|
| 31 | +$mail->AddReplyTo("replyto@yourdomain.com","Webmaster");
|
| 32 | +
|
| 33 | +$mail->AddAttachment("/path/to/file.zip"); // attachment
|
| 34 | +$mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment
|
| 35 | +
|
| 36 | +$mail->AddAddress("username@domain.com","First Last");
|
| 37 | +
|
| 38 | +$mail->IsHTML(true); // send as HTML
|
| 39 | +
|
| 40 | +if(!$mail->Send()) {
|
| 41 | + echo "Mailer Error: " . $mail->ErrorInfo;
|
| 42 | +} else {
|
| 43 | + echo "Message has been sent";
|
| 44 | +}
|
| 45 | +
|
| 46 | +?>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/use_gmail.txt |
___________________________________________________________________ |
Added: svn:executable |
1 | 47 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/Callback_function_notes.txt |
— | — | @@ -0,0 +1,17 @@ |
| 2 | +NEW CALLBACK FUNCTION:
|
| 3 | +======================
|
| 4 | +
|
| 5 | +We have had requests for a method to process the results of sending emails
|
| 6 | +through PHPMailer. In this new release, we have implemented a callback
|
| 7 | +function that passes the results of each email sent (to, cc, and/or bcc).
|
| 8 | +We have provided an example that echos the results back to the screen. The
|
| 9 | +callback function can be used for any purpose. With minor modifications, the
|
| 10 | +callback function can be used to create CSV logs, post results to databases,
|
| 11 | +etc.
|
| 12 | +
|
| 13 | +Please review the test.php script for the example.
|
| 14 | +
|
| 15 | +It's pretty straight forward.
|
| 16 | +
|
| 17 | +Enjoy!
|
| 18 | +Andy
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/Callback_function_notes.txt |
___________________________________________________________________ |
Added: svn:executable |
1 | 19 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/Note_for_SMTP_debugging.txt |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +If you are having problems connecting or sending emails through your SMTP server, please note:
|
| 3 | +
|
| 4 | +1. The new rewrite of class.smtp.php provides more information about the processing/errors taking place
|
| 5 | +2. Use the debug functionality of class.smtp.php. To do that, in your own script add the debug level you wish to use. An example of that is:
|
| 6 | +
|
| 7 | +$mail->SMTPDebug = 1;
|
| 8 | +$mail->IsSMTP(); // telling the class to use SMTP
|
| 9 | +$mail->SMTPAuth = true; // enable SMTP authentication
|
| 10 | +$mail->Port = 26; // set the SMTP port
|
| 11 | +$mail->Host = "mail.yourhost.com"; // SMTP server
|
| 12 | +$mail->Username = "name@yourhost.com"; // SMTP account username
|
| 13 | +$mail->Password = "your password"; // SMTP account password
|
| 14 | +
|
| 15 | +Notes on this:
|
| 16 | +$mail->SMTPDebug = 0; ... will disable debugging (you can also leave this out completely, 0 is the default
|
| 17 | +$mail->SMTPDebug = 1; ... will echo errors and messages
|
| 18 | +$mail->SMTPDebug = 2; ... will echo messages only
|
| 19 | +... and finally, the options are 0, 1, and 2 ... any number greater than 2 will be interpreted as 2
|
| 20 | +
|
| 21 | +And finally, don't forget to disable debugging before going into production.
|
| 22 | +
|
| 23 | +Enjoy!
|
| 24 | +Andy |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/Note_for_SMTP_debugging.txt |
___________________________________________________________________ |
Added: svn:executable |
1 | 25 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/extending.html |
— | — | @@ -0,0 +1,148 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>Examples using phpmailer</title>
|
| 5 | +</head>
|
| 6 | +
|
| 7 | +<body bgcolor="#FFFFFF">
|
| 8 | +
|
| 9 | +<h2>Examples using phpmailer</h2>
|
| 10 | +
|
| 11 | +<h3>1. Advanced Example</h3>
|
| 12 | +<p>
|
| 13 | +
|
| 14 | +This demonstrates sending out multiple email messages with binary attachments
|
| 15 | +from a MySQL database with multipart/alternative support.<p>
|
| 16 | +<table cellpadding="4" border="1" width="80%">
|
| 17 | +<tr>
|
| 18 | +<td bgcolor="#CCCCCC">
|
| 19 | +<pre>
|
| 20 | +require("class.phpmailer.php");
|
| 21 | +
|
| 22 | +$mail = new phpmailer();
|
| 23 | +
|
| 24 | +$mail->From = "list@example.com";
|
| 25 | +$mail->FromName = "List manager";
|
| 26 | +$mail->Host = "smtp1.example.com;smtp2.example.com";
|
| 27 | +$mail->Mailer = "smtp";
|
| 28 | +
|
| 29 | +@MYSQL_CONNECT("localhost","root","password");
|
| 30 | +@mysql_select_db("my_company");
|
| 31 | +$query� =�"SELECT full_name, email,�photo�FROM employee�WHERE�id=$id";
|
| 32 | +$result�=�@MYSQL_QUERY($query);
|
| 33 | +
|
| 34 | +while ($row = mysql_fetch_array ($result))
|
| 35 | +{
|
| 36 | + // HTML body
|
| 37 | + $body = "Hello <font size=\"4\">" . $row["full_name"] . "</font>, <p>";
|
| 38 | + $body .= "<i>Your</i> personal photograph to this message.<p>";
|
| 39 | + $body .= "Sincerely, <br>";
|
| 40 | + $body .= "phpmailer List manager";
|
| 41 | +
|
| 42 | + // Plain text body (for mail clients that cannot read HTML)
|
| 43 | + $text_body = "Hello " . $row["full_name"] . ", \n\n";
|
| 44 | + $text_body .= "Your personal photograph to this message.\n\n";
|
| 45 | + $text_body .= "Sincerely, \n";
|
| 46 | + $text_body .= "phpmailer List manager";
|
| 47 | +
|
| 48 | + $mail->Body = $body;
|
| 49 | + $mail->AltBody = $text_body;
|
| 50 | + $mail->AddAddress($row["email"], $row["full_name"]);
|
| 51 | + $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
|
| 52 | +
|
| 53 | + if(!$mail->Send())
|
| 54 | + echo "There has been a mail error sending to " . $row["email"] . "<br>";
|
| 55 | +
|
| 56 | + // Clear all addresses and attachments for next loop
|
| 57 | + $mail->ClearAddresses();
|
| 58 | + $mail->ClearAttachments();
|
| 59 | +}
|
| 60 | +</pre>
|
| 61 | +</td>
|
| 62 | +</tr>
|
| 63 | +</table>
|
| 64 | +<p>
|
| 65 | +
|
| 66 | +<h3>2. Extending phpmailer</h3>
|
| 67 | +<p>
|
| 68 | +
|
| 69 | +Extending classes with inheritance is one of the most
|
| 70 | +powerful features of object-oriented
|
| 71 | +programming. It allows you to make changes to the
|
| 72 | +original class for your
|
| 73 | +own personal use without hacking the original
|
| 74 | +classes. Plus, it is very
|
| 75 | +easy to do. I've provided an example:
|
| 76 | +
|
| 77 | +<p>
|
| 78 | +Here's a class that extends the phpmailer class and sets the defaults
|
| 79 | +for the particular site:<br>
|
| 80 | +PHP include file: <b>mail.inc.php</b>
|
| 81 | +<p>
|
| 82 | +
|
| 83 | +<table cellpadding="4" border="1" width="80%">
|
| 84 | +<tr>
|
| 85 | +<td bgcolor="#CCCCCC">
|
| 86 | +<pre>
|
| 87 | +require("class.phpmailer.php");
|
| 88 | +
|
| 89 | +class my_phpmailer extends phpmailer {
|
| 90 | + // Set default variables for all new objects
|
| 91 | + var $From = "from@example.com";
|
| 92 | + var $FromName = "Mailer";
|
| 93 | + var $Host = "smtp1.example.com;smtp2.example.com";
|
| 94 | + var $Mailer = "smtp"; // Alternative to IsSMTP()
|
| 95 | + var $WordWrap = 75;
|
| 96 | +
|
| 97 | + // Replace the default error_handler
|
| 98 | + function error_handler($msg) {
|
| 99 | + print("My Site Error");
|
| 100 | + print("Description:");
|
| 101 | + printf("%s", $msg);
|
| 102 | + exit;
|
| 103 | + }
|
| 104 | +
|
| 105 | + // Create an additional function
|
| 106 | + function do_something($something) {
|
| 107 | + // Place your new code here
|
| 108 | + }
|
| 109 | +}
|
| 110 | +</td>
|
| 111 | +</tr>
|
| 112 | +</table>
|
| 113 | +<br>
|
| 114 | +
|
| 115 | +Now here's a normal PHP page in the site, which will have all the defaults set
|
| 116 | +above:<br>
|
| 117 | +Normal PHP file: <b>mail_test.php</b>
|
| 118 | +<p>
|
| 119 | +
|
| 120 | +<table cellpadding="4" border="1" width="80%">
|
| 121 | +<tr>
|
| 122 | +<td bgcolor="#CCCCCC">
|
| 123 | +<pre>
|
| 124 | +require("mail.inc.php");
|
| 125 | +
|
| 126 | +// Instantiate your new class
|
| 127 | +$mail = new my_phpmailer;
|
| 128 | +
|
| 129 | +// Now you only need to add the necessary stuff
|
| 130 | +$mail->AddAddress("josh@example.com", "Josh Adams");
|
| 131 | +$mail->Subject = "Here is the subject";
|
| 132 | +$mail->Body = "This is the message body";
|
| 133 | +$mail->AddAttachment("c:/temp/11-10-00.zip", "new_name.zip"); // optional name
|
| 134 | +
|
| 135 | +if(!$mail->Send())
|
| 136 | +{
|
| 137 | + echo "There was an error sending the message";
|
| 138 | + exit;
|
| 139 | +}
|
| 140 | +
|
| 141 | +echo "Message was sent successfully";
|
| 142 | +</pre>
|
| 143 | +</td>
|
| 144 | +</tr>
|
| 145 | +</table>
|
| 146 | +</p>
|
| 147 | +
|
| 148 | +</body>
|
| 149 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/extending.html |
___________________________________________________________________ |
Added: svn:executable |
1 | 150 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/DomainKeys_notes.txt |
— | — | @@ -0,0 +1,55 @@ |
| 2 | +CREATE DKIM KEYS and DNS Resource Record:
|
| 3 | +=========================================
|
| 4 | +
|
| 5 | +To create DomainKeys Identified Mail keys, visit:
|
| 6 | +http://dkim.worxware.com/
|
| 7 | +... read the information, fill in the form, and download the ZIP file
|
| 8 | +containing the public key, private key, DNS Resource Record and instructions
|
| 9 | +to add to your DNS Zone Record, and the PHPMailer code to enable DKIM
|
| 10 | +digital signing.
|
| 11 | +
|
| 12 | +/*** PROTECT YOUR PRIVATE & PUBLIC KEYS ***/
|
| 13 | +
|
| 14 | +You need to protect your DKIM private and public keys from being viewed or
|
| 15 | +accessed. Add protection to your .htaccess file as in this example:
|
| 16 | +
|
| 17 | +# secure htkeyprivate file
|
| 18 | +<Files .htkeyprivate>
|
| 19 | + order allow,deny
|
| 20 | + deny from all
|
| 21 | +</Files>
|
| 22 | +
|
| 23 | +# secure htkeypublic file
|
| 24 | +<Files .htkeypublic>
|
| 25 | + order allow,deny
|
| 26 | + deny from all
|
| 27 | +</Files>
|
| 28 | +
|
| 29 | +(the actual .htaccess additions are in the ZIP file sent back to you from
|
| 30 | +http://dkim.worxware.com/
|
| 31 | +
|
| 32 | +A few notes on using DomainKey Identified Mail (DKIM):
|
| 33 | +
|
| 34 | +You do not need to use PHPMailer to DKIM sign emails IF:
|
| 35 | +- you enable DomainKey support and add the DNS resource record
|
| 36 | +- you use your outbound mail server
|
| 37 | +
|
| 38 | +If you are a third-party emailer that works on behalf of domain owners to
|
| 39 | +send their emails from your own server:
|
| 40 | +- you absolutely have to DKIM sign outbound emails
|
| 41 | +- the domain owner has to add the DNS resource record to match the
|
| 42 | + private key, public key, selector, identity, and domain that you create
|
| 43 | +- use caution with the "selector" ... at least one "selector" will already
|
| 44 | + exist in the DNS Zone Record of the domain at the domain owner's server
|
| 45 | + you need to ensure that the "selector" you use is unique
|
| 46 | +Note: since the IP address will not match the domain owner's DNS Zone record
|
| 47 | +you can be certain that email providers that validate based on DomainKey will
|
| 48 | +check the domain owner's DNS Zone record for your DNS resource record. Before
|
| 49 | +sending out emails on behalf of domain owners, ensure they have entered the
|
| 50 | +DNS resource record you provided them.
|
| 51 | +
|
| 52 | +Enjoy!
|
| 53 | +Andy
|
| 54 | +
|
| 55 | +PS. if you need additional information about DKIM, please see:
|
| 56 | +http://www.dkim.org/info/dkim-faq.html
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/DomainKeys_notes.txt |
___________________________________________________________________ |
Added: svn:executable |
1 | 57 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/faq.html |
— | — | @@ -0,0 +1,67 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer FAQ</title>
|
| 5 | +<style>
|
| 6 | +body, p {
|
| 7 | + font-family: Arial, Helvetica, sans-serif;
|
| 8 | + font-size: 12px;
|
| 9 | +}
|
| 10 | +div.width {
|
| 11 | + width: 500px;
|
| 12 | + text-align: left;
|
| 13 | +}
|
| 14 | +</style>
|
| 15 | +</head>
|
| 16 | +<body bgcolor="#FFFFFF">
|
| 17 | +<center>
|
| 18 | +<div class="width">
|
| 19 | +<h2>PHPMailer FAQ</h2>
|
| 20 | +<ul>
|
| 21 | +
|
| 22 | + <li><b style="background-color: #FFFF00">Q:</b> <b>I'm using the SMTP mailer and I keep on getting a timeout message
|
| 23 | + well before the X seconds I set it for. What gives?</b><br />
|
| 24 | + <b style="background-color: #FFFF00">A:</b> PHP versions 4.0.4pl1 and earlier have a bug in which sockets timeout
|
| 25 | + early. You can fix this by re-compiling PHP 4.0.4pl1 with this fix:
|
| 26 | + <a href="timeoutfix.diff">timeoutfix.diff</a>. Otherwise you can wait for the new PHP release.<br /><br /></li>
|
| 27 | +
|
| 28 | + <li><b style="background-color: #FFFF00">Q:</b> <b>I am concerned that using include files will take up too much
|
| 29 | + processing time on my computer. How can I make it run faster?</b><br />
|
| 30 | + <b style="background-color: #FFFF00">A:</b> PHP by itself is very fast. Much faster than ASP or JSP running on
|
| 31 | + the same type of server. This is because it has very little overhead compared
|
| 32 | + to its competitors and it pre-compiles all of
|
| 33 | + its code before it runs each script (in PHP4). However, all of
|
| 34 | + this compiling and re-compiling can take up a lot of valuable
|
| 35 | + computer resources. However, there are programs out there that compile
|
| 36 | + PHP code and store it in memory (or on mmaped files) to reduce the
|
| 37 | + processing immensely. Two of these: <a href="http://apc.communityconnect.com">APC
|
| 38 | + (Alternative PHP Cache)</a> and <a href="http://bwcache.bware.it/index.htm">Afterburner</a>
|
| 39 | + (<a href="http://www.mm4.de/php4win/mod_php4_win32/">Win32 download</a>)
|
| 40 | + are excellent free tools that do just this. If you have the money
|
| 41 | + you might also try <a href="http://www.zend.com">Zend Cache</a>, it is
|
| 42 | + even faster than the open source varieties. All of these tools make your
|
| 43 | + scripts run faster while also reducing the load on your server. I have tried
|
| 44 | + them myself and they are quite stable too.<br /><br /></li>
|
| 45 | +
|
| 46 | + <li><b style="background-color: #FFFF00">Q:</b> <b>What mailer gives me the best performance?</b><br />
|
| 47 | + <b style="background-color: #FFFF00">A:</b> On a single machine the <b>sendmail (or Qmail)</b> is fastest overall.
|
| 48 | + Next fastest is mail() to give you the best performance. Both do not have the overhead of SMTP.
|
| 49 | + If you have you have your mail server on a another machine then
|
| 50 | + SMTP is your only option, but you do get the benefit of redundant mail servers.<br />
|
| 51 | + If you are running a mailing list with thousands of names, the fastest mailers in order are: SMTP, sendmail (or Qmail), mail().<br /><br /></li>
|
| 52 | +
|
| 53 | + <li><b style="background-color: #FFFF00">Q:</b> <b>When I try to attach a file with on my server I get a
|
| 54 | + "Could not find {file} on filesystem error". Why is this?</b><br />
|
| 55 | + <b style="background-color: #FFFF00">A:</b> If you are using a Unix machine this is probably because the user
|
| 56 | + running your web server does not have read access to the directory in question. If you are using Windows,
|
| 57 | + then the problem probably is that you have used single backslashes to denote directories (\).
|
| 58 | + A single backslash has a special meaning to PHP so these are not
|
| 59 | + valid. Instead use double backslashes ("\\") or a single forward
|
| 60 | + slash ("/").<br /><br /></li>
|
| 61 | +
|
| 62 | +</ul>
|
| 63 | +
|
| 64 | +</div>
|
| 65 | +</center>
|
| 66 | +
|
| 67 | +</body>
|
| 68 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/docs/faq.html |
___________________________________________________________________ |
Added: svn:executable |
1 | 69 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/class.phpmailer.php |
— | — | @@ -0,0 +1,2320 @@ |
| 2 | +<?php |
| 3 | +/*~ class.phpmailer.php |
| 4 | +.---------------------------------------------------------------------------. |
| 5 | +| Software: PHPMailer - PHP email class | |
| 6 | +| Version: 5.1 | |
| 7 | +| Contact: via sourceforge.net support pages (also www.worxware.com) | |
| 8 | +| Info: http://phpmailer.sourceforge.net | |
| 9 | +| Support: http://sourceforge.net/projects/phpmailer/ | |
| 10 | +| ------------------------------------------------------------------------- | |
| 11 | +| Admin: Andy Prevost (project admininistrator) | |
| 12 | +| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net | |
| 13 | +| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | |
| 14 | +| Founder: Brent R. Matzelle (original founder) | |
| 15 | +| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | |
| 16 | +| Copyright (c) 2001-2003, Brent R. Matzelle | |
| 17 | +| ------------------------------------------------------------------------- | |
| 18 | +| License: Distributed under the Lesser General Public License (LGPL) | |
| 19 | +| http://www.gnu.org/copyleft/lesser.html | |
| 20 | +| This program is distributed in the hope that it will be useful - WITHOUT | |
| 21 | +| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 22 | +| FITNESS FOR A PARTICULAR PURPOSE. | |
| 23 | +| ------------------------------------------------------------------------- | |
| 24 | +| We offer a number of paid services (www.worxware.com): | |
| 25 | +| - Web Hosting on highly optimized fast and secure servers | |
| 26 | +| - Technology Consulting | |
| 27 | +| - Oursourcing (highly qualified programmers and graphic designers) | |
| 28 | +'---------------------------------------------------------------------------' |
| 29 | +*/ |
| 30 | + |
| 31 | +/** |
| 32 | + * PHPMailer - PHP email transport class |
| 33 | + * NOTE: Requires PHP version 5 or later |
| 34 | + * @package PHPMailer |
| 35 | + * @author Andy Prevost |
| 36 | + * @author Marcus Bointon |
| 37 | + * @copyright 2004 - 2009 Andy Prevost |
| 38 | + * @version $Id: class.phpmailer.php 447 2009-05-25 01:36:38Z codeworxtech $ |
| 39 | + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License |
| 40 | + */ |
| 41 | + |
| 42 | +if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n"); |
| 43 | + |
| 44 | +class PHPMailer { |
| 45 | + |
| 46 | + ///////////////////////////////////////////////// |
| 47 | + // PROPERTIES, PUBLIC |
| 48 | + ///////////////////////////////////////////////// |
| 49 | + |
| 50 | + /** |
| 51 | + * Email priority (1 = High, 3 = Normal, 5 = low). |
| 52 | + * @var int |
| 53 | + */ |
| 54 | + public $Priority = 3; |
| 55 | + |
| 56 | + /** |
| 57 | + * Sets the CharSet of the message. |
| 58 | + * @var string |
| 59 | + */ |
| 60 | + public $CharSet = 'iso-8859-1'; |
| 61 | + |
| 62 | + /** |
| 63 | + * Sets the Content-type of the message. |
| 64 | + * @var string |
| 65 | + */ |
| 66 | + public $ContentType = 'text/plain'; |
| 67 | + |
| 68 | + /** |
| 69 | + * Sets the Encoding of the message. Options for this are |
| 70 | + * "8bit", "7bit", "binary", "base64", and "quoted-printable". |
| 71 | + * @var string |
| 72 | + */ |
| 73 | + public $Encoding = '8bit'; |
| 74 | + |
| 75 | + /** |
| 76 | + * Holds the most recent mailer error message. |
| 77 | + * @var string |
| 78 | + */ |
| 79 | + public $ErrorInfo = ''; |
| 80 | + |
| 81 | + /** |
| 82 | + * Sets the From email address for the message. |
| 83 | + * @var string |
| 84 | + */ |
| 85 | + public $From = 'root@localhost'; |
| 86 | + |
| 87 | + /** |
| 88 | + * Sets the From name of the message. |
| 89 | + * @var string |
| 90 | + */ |
| 91 | + public $FromName = 'Root User'; |
| 92 | + |
| 93 | + /** |
| 94 | + * Sets the Sender email (Return-Path) of the message. If not empty, |
| 95 | + * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. |
| 96 | + * @var string |
| 97 | + */ |
| 98 | + public $Sender = ''; |
| 99 | + |
| 100 | + /** |
| 101 | + * Sets the Subject of the message. |
| 102 | + * @var string |
| 103 | + */ |
| 104 | + public $Subject = ''; |
| 105 | + |
| 106 | + /** |
| 107 | + * Sets the Body of the message. This can be either an HTML or text body. |
| 108 | + * If HTML then run IsHTML(true). |
| 109 | + * @var string |
| 110 | + */ |
| 111 | + public $Body = ''; |
| 112 | + |
| 113 | + /** |
| 114 | + * Sets the text-only body of the message. This automatically sets the |
| 115 | + * email to multipart/alternative. This body can be read by mail |
| 116 | + * clients that do not have HTML email capability such as mutt. Clients |
| 117 | + * that can read HTML will view the normal Body. |
| 118 | + * @var string |
| 119 | + */ |
| 120 | + public $AltBody = ''; |
| 121 | + |
| 122 | + /** |
| 123 | + * Sets word wrapping on the body of the message to a given number of |
| 124 | + * characters. |
| 125 | + * @var int |
| 126 | + */ |
| 127 | + public $WordWrap = 0; |
| 128 | + |
| 129 | + /** |
| 130 | + * Method to send mail: ("mail", "sendmail", or "smtp"). |
| 131 | + * @var string |
| 132 | + */ |
| 133 | + public $Mailer = 'mail'; |
| 134 | + |
| 135 | + /** |
| 136 | + * Sets the path of the sendmail program. |
| 137 | + * @var string |
| 138 | + */ |
| 139 | + public $Sendmail = '/usr/sbin/sendmail'; |
| 140 | + |
| 141 | + /** |
| 142 | + * Path to PHPMailer plugins. Useful if the SMTP class |
| 143 | + * is in a different directory than the PHP include path. |
| 144 | + * @var string |
| 145 | + */ |
| 146 | + public $PluginDir = ''; |
| 147 | + |
| 148 | + /** |
| 149 | + * Sets the email address that a reading confirmation will be sent. |
| 150 | + * @var string |
| 151 | + */ |
| 152 | + public $ConfirmReadingTo = ''; |
| 153 | + |
| 154 | + /** |
| 155 | + * Sets the hostname to use in Message-Id and Received headers |
| 156 | + * and as default HELO string. If empty, the value returned |
| 157 | + * by SERVER_NAME is used or 'localhost.localdomain'. |
| 158 | + * @var string |
| 159 | + */ |
| 160 | + public $Hostname = ''; |
| 161 | + |
| 162 | + /** |
| 163 | + * Sets the message ID to be used in the Message-Id header. |
| 164 | + * If empty, a unique id will be generated. |
| 165 | + * @var string |
| 166 | + */ |
| 167 | + public $MessageID = ''; |
| 168 | + |
| 169 | + ///////////////////////////////////////////////// |
| 170 | + // PROPERTIES FOR SMTP |
| 171 | + ///////////////////////////////////////////////// |
| 172 | + |
| 173 | + /** |
| 174 | + * Sets the SMTP hosts. All hosts must be separated by a |
| 175 | + * semicolon. You can also specify a different port |
| 176 | + * for each host by using this format: [hostname:port] |
| 177 | + * (e.g. "smtp1.example.com:25;smtp2.example.com"). |
| 178 | + * Hosts will be tried in order. |
| 179 | + * @var string |
| 180 | + */ |
| 181 | + public $Host = 'localhost'; |
| 182 | + |
| 183 | + /** |
| 184 | + * Sets the default SMTP server port. |
| 185 | + * @var int |
| 186 | + */ |
| 187 | + public $Port = 25; |
| 188 | + |
| 189 | + /** |
| 190 | + * Sets the SMTP HELO of the message (Default is $Hostname). |
| 191 | + * @var string |
| 192 | + */ |
| 193 | + public $Helo = ''; |
| 194 | + |
| 195 | + /** |
| 196 | + * Sets connection prefix. |
| 197 | + * Options are "", "ssl" or "tls" |
| 198 | + * @var string |
| 199 | + */ |
| 200 | + public $SMTPSecure = ''; |
| 201 | + |
| 202 | + /** |
| 203 | + * Sets SMTP authentication. Utilizes the Username and Password variables. |
| 204 | + * @var bool |
| 205 | + */ |
| 206 | + public $SMTPAuth = false; |
| 207 | + |
| 208 | + /** |
| 209 | + * Sets SMTP username. |
| 210 | + * @var string |
| 211 | + */ |
| 212 | + public $Username = ''; |
| 213 | + |
| 214 | + /** |
| 215 | + * Sets SMTP password. |
| 216 | + * @var string |
| 217 | + */ |
| 218 | + public $Password = ''; |
| 219 | + |
| 220 | + /** |
| 221 | + * Sets the SMTP server timeout in seconds. |
| 222 | + * This function will not work with the win32 version. |
| 223 | + * @var int |
| 224 | + */ |
| 225 | + public $Timeout = 10; |
| 226 | + |
| 227 | + /** |
| 228 | + * Sets SMTP class debugging on or off. |
| 229 | + * @var bool |
| 230 | + */ |
| 231 | + public $SMTPDebug = false; |
| 232 | + |
| 233 | + /** |
| 234 | + * Prevents the SMTP connection from being closed after each mail |
| 235 | + * sending. If this is set to true then to close the connection |
| 236 | + * requires an explicit call to SmtpClose(). |
| 237 | + * @var bool |
| 238 | + */ |
| 239 | + public $SMTPKeepAlive = false; |
| 240 | + |
| 241 | + /** |
| 242 | + * Provides the ability to have the TO field process individual |
| 243 | + * emails, instead of sending to entire TO addresses |
| 244 | + * @var bool |
| 245 | + */ |
| 246 | + public $SingleTo = false; |
| 247 | + |
| 248 | + /** |
| 249 | + * If SingleTo is true, this provides the array to hold the email addresses |
| 250 | + * @var bool |
| 251 | + */ |
| 252 | + public $SingleToArray = array(); |
| 253 | + |
| 254 | + /** |
| 255 | + * Provides the ability to change the line ending |
| 256 | + * @var string |
| 257 | + */ |
| 258 | + public $LE = "\n"; |
| 259 | + |
| 260 | + /** |
| 261 | + * Used with DKIM DNS Resource Record |
| 262 | + * @var string |
| 263 | + */ |
| 264 | + public $DKIM_selector = 'phpmailer'; |
| 265 | + |
| 266 | + /** |
| 267 | + * Used with DKIM DNS Resource Record |
| 268 | + * optional, in format of email address 'you@yourdomain.com' |
| 269 | + * @var string |
| 270 | + */ |
| 271 | + public $DKIM_identity = ''; |
| 272 | + |
| 273 | + /** |
| 274 | + * Used with DKIM DNS Resource Record |
| 275 | + * optional, in format of email address 'you@yourdomain.com' |
| 276 | + * @var string |
| 277 | + */ |
| 278 | + public $DKIM_domain = ''; |
| 279 | + |
| 280 | + /** |
| 281 | + * Used with DKIM DNS Resource Record |
| 282 | + * optional, in format of email address 'you@yourdomain.com' |
| 283 | + * @var string |
| 284 | + */ |
| 285 | + public $DKIM_private = ''; |
| 286 | + |
| 287 | + /** |
| 288 | + * Callback Action function name |
| 289 | + * the function that handles the result of the send email action. Parameters: |
| 290 | + * bool $result result of the send action |
| 291 | + * string $to email address of the recipient |
| 292 | + * string $cc cc email addresses |
| 293 | + * string $bcc bcc email addresses |
| 294 | + * string $subject the subject |
| 295 | + * string $body the email body |
| 296 | + * @var string |
| 297 | + */ |
| 298 | + public $action_function = ''; //'callbackAction'; |
| 299 | + |
| 300 | + /** |
| 301 | + * Sets the PHPMailer Version number |
| 302 | + * @var string |
| 303 | + */ |
| 304 | + public $Version = '5.1'; |
| 305 | + |
| 306 | + ///////////////////////////////////////////////// |
| 307 | + // PROPERTIES, PRIVATE AND PROTECTED |
| 308 | + ///////////////////////////////////////////////// |
| 309 | + |
| 310 | + private $smtp = NULL; |
| 311 | + private $to = array(); |
| 312 | + private $cc = array(); |
| 313 | + private $bcc = array(); |
| 314 | + private $ReplyTo = array(); |
| 315 | + private $all_recipients = array(); |
| 316 | + private $attachment = array(); |
| 317 | + private $CustomHeader = array(); |
| 318 | + private $message_type = ''; |
| 319 | + private $boundary = array(); |
| 320 | + protected $language = array(); |
| 321 | + private $error_count = 0; |
| 322 | + private $sign_cert_file = ""; |
| 323 | + private $sign_key_file = ""; |
| 324 | + private $sign_key_pass = ""; |
| 325 | + private $exceptions = false; |
| 326 | + |
| 327 | + ///////////////////////////////////////////////// |
| 328 | + // CONSTANTS |
| 329 | + ///////////////////////////////////////////////// |
| 330 | + |
| 331 | + const STOP_MESSAGE = 0; // message only, continue processing |
| 332 | + const STOP_CONTINUE = 1; // message?, likely ok to continue processing |
| 333 | + const STOP_CRITICAL = 2; // message, plus full stop, critical error reached |
| 334 | + |
| 335 | + ///////////////////////////////////////////////// |
| 336 | + // METHODS, VARIABLES |
| 337 | + ///////////////////////////////////////////////// |
| 338 | + |
| 339 | + /** |
| 340 | + * Constructor |
| 341 | + * @param boolean $exceptions Should we throw external exceptions? |
| 342 | + */ |
| 343 | + public function __construct($exceptions = false) { |
| 344 | + $this->exceptions = ($exceptions == true); |
| 345 | + } |
| 346 | + |
| 347 | + /** |
| 348 | + * Sets message type to HTML. |
| 349 | + * @param bool $ishtml |
| 350 | + * @return void |
| 351 | + */ |
| 352 | + public function IsHTML($ishtml = true) { |
| 353 | + if ($ishtml) { |
| 354 | + $this->ContentType = 'text/html'; |
| 355 | + } else { |
| 356 | + $this->ContentType = 'text/plain'; |
| 357 | + } |
| 358 | + } |
| 359 | + |
| 360 | + /** |
| 361 | + * Sets Mailer to send message using SMTP. |
| 362 | + * @return void |
| 363 | + */ |
| 364 | + public function IsSMTP() { |
| 365 | + $this->Mailer = 'smtp'; |
| 366 | + } |
| 367 | + |
| 368 | + /** |
| 369 | + * Sets Mailer to send message using PHP mail() function. |
| 370 | + * @return void |
| 371 | + */ |
| 372 | + public function IsMail() { |
| 373 | + $this->Mailer = 'mail'; |
| 374 | + } |
| 375 | + |
| 376 | + /** |
| 377 | + * Sets Mailer to send message using the $Sendmail program. |
| 378 | + * @return void |
| 379 | + */ |
| 380 | + public function IsSendmail() { |
| 381 | + if (!stristr(ini_get('sendmail_path'), 'sendmail')) { |
| 382 | + $this->Sendmail = '/var/qmail/bin/sendmail'; |
| 383 | + } |
| 384 | + $this->Mailer = 'sendmail'; |
| 385 | + } |
| 386 | + |
| 387 | + /** |
| 388 | + * Sets Mailer to send message using the qmail MTA. |
| 389 | + * @return void |
| 390 | + */ |
| 391 | + public function IsQmail() { |
| 392 | + if (stristr(ini_get('sendmail_path'), 'qmail')) { |
| 393 | + $this->Sendmail = '/var/qmail/bin/sendmail'; |
| 394 | + } |
| 395 | + $this->Mailer = 'sendmail'; |
| 396 | + } |
| 397 | + |
| 398 | + ///////////////////////////////////////////////// |
| 399 | + // METHODS, RECIPIENTS |
| 400 | + ///////////////////////////////////////////////// |
| 401 | + |
| 402 | + /** |
| 403 | + * Adds a "To" address. |
| 404 | + * @param string $address |
| 405 | + * @param string $name |
| 406 | + * @return boolean true on success, false if address already used |
| 407 | + */ |
| 408 | + public function AddAddress($address, $name = '') { |
| 409 | + return $this->AddAnAddress('to', $address, $name); |
| 410 | + } |
| 411 | + |
| 412 | + /** |
| 413 | + * Adds a "Cc" address. |
| 414 | + * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. |
| 415 | + * @param string $address |
| 416 | + * @param string $name |
| 417 | + * @return boolean true on success, false if address already used |
| 418 | + */ |
| 419 | + public function AddCC($address, $name = '') { |
| 420 | + return $this->AddAnAddress('cc', $address, $name); |
| 421 | + } |
| 422 | + |
| 423 | + /** |
| 424 | + * Adds a "Bcc" address. |
| 425 | + * Note: this function works with the SMTP mailer on win32, not with the "mail" mailer. |
| 426 | + * @param string $address |
| 427 | + * @param string $name |
| 428 | + * @return boolean true on success, false if address already used |
| 429 | + */ |
| 430 | + public function AddBCC($address, $name = '') { |
| 431 | + return $this->AddAnAddress('bcc', $address, $name); |
| 432 | + } |
| 433 | + |
| 434 | + /** |
| 435 | + * Adds a "Reply-to" address. |
| 436 | + * @param string $address |
| 437 | + * @param string $name |
| 438 | + * @return boolean |
| 439 | + */ |
| 440 | + public function AddReplyTo($address, $name = '') { |
| 441 | + return $this->AddAnAddress('ReplyTo', $address, $name); |
| 442 | + } |
| 443 | + |
| 444 | + /** |
| 445 | + * Adds an address to one of the recipient arrays |
| 446 | + * Addresses that have been added already return false, but do not throw exceptions |
| 447 | + * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo' |
| 448 | + * @param string $address The email address to send to |
| 449 | + * @param string $name |
| 450 | + * @return boolean true on success, false if address already used or invalid in some way |
| 451 | + * @access private |
| 452 | + */ |
| 453 | + private function AddAnAddress($kind, $address, $name = '') { |
| 454 | + if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) { |
| 455 | + echo 'Invalid recipient array: ' . kind; |
| 456 | + return false; |
| 457 | + } |
| 458 | + $address = trim($address); |
| 459 | + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim |
| 460 | + if (!self::ValidateAddress($address)) { |
| 461 | + $this->SetError($this->Lang('invalid_address').': '. $address); |
| 462 | + if ($this->exceptions) { |
| 463 | + throw new phpmailerException($this->Lang('invalid_address').': '.$address); |
| 464 | + } |
| 465 | + echo $this->Lang('invalid_address').': '.$address; |
| 466 | + return false; |
| 467 | + } |
| 468 | + if ($kind != 'ReplyTo') { |
| 469 | + if (!isset($this->all_recipients[strtolower($address)])) { |
| 470 | + array_push($this->$kind, array($address, $name)); |
| 471 | + $this->all_recipients[strtolower($address)] = true; |
| 472 | + return true; |
| 473 | + } |
| 474 | + } else { |
| 475 | + if (!array_key_exists(strtolower($address), $this->ReplyTo)) { |
| 476 | + $this->ReplyTo[strtolower($address)] = array($address, $name); |
| 477 | + return true; |
| 478 | + } |
| 479 | + } |
| 480 | + return false; |
| 481 | +} |
| 482 | + |
| 483 | +/** |
| 484 | + * Set the From and FromName properties |
| 485 | + * @param string $address |
| 486 | + * @param string $name |
| 487 | + * @return boolean |
| 488 | + */ |
| 489 | + public function SetFrom($address, $name = '',$auto=1) { |
| 490 | + $address = trim($address); |
| 491 | + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim |
| 492 | + if (!self::ValidateAddress($address)) { |
| 493 | + $this->SetError($this->Lang('invalid_address').': '. $address); |
| 494 | + if ($this->exceptions) { |
| 495 | + throw new phpmailerException($this->Lang('invalid_address').': '.$address); |
| 496 | + } |
| 497 | + echo $this->Lang('invalid_address').': '.$address; |
| 498 | + return false; |
| 499 | + } |
| 500 | + $this->From = $address; |
| 501 | + $this->FromName = $name; |
| 502 | + if ($auto) { |
| 503 | + if (empty($this->ReplyTo)) { |
| 504 | + $this->AddAnAddress('ReplyTo', $address, $name); |
| 505 | + } |
| 506 | + if (empty($this->Sender)) { |
| 507 | + $this->Sender = $address; |
| 508 | + } |
| 509 | + } |
| 510 | + return true; |
| 511 | + } |
| 512 | + |
| 513 | + /** |
| 514 | + * Check that a string looks roughly like an email address should |
| 515 | + * Static so it can be used without instantiation |
| 516 | + * Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator |
| 517 | + * Conforms approximately to RFC2822 |
| 518 | + * @link http://www.hexillion.com/samples/#Regex Original pattern found here |
| 519 | + * @param string $address The email address to check |
| 520 | + * @return boolean |
| 521 | + * @static |
| 522 | + * @access public |
| 523 | + */ |
| 524 | + public static function ValidateAddress($address) { |
| 525 | + if (function_exists('filter_var')) { //Introduced in PHP 5.2 |
| 526 | + if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) { |
| 527 | + return false; |
| 528 | + } else { |
| 529 | + return true; |
| 530 | + } |
| 531 | + } else { |
| 532 | + return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address); |
| 533 | + } |
| 534 | + } |
| 535 | + |
| 536 | + ///////////////////////////////////////////////// |
| 537 | + // METHODS, MAIL SENDING |
| 538 | + ///////////////////////////////////////////////// |
| 539 | + |
| 540 | + /** |
| 541 | + * Creates message and assigns Mailer. If the message is |
| 542 | + * not sent successfully then it returns false. Use the ErrorInfo |
| 543 | + * variable to view description of the error. |
| 544 | + * @return bool |
| 545 | + */ |
| 546 | + public function Send() { |
| 547 | + try { |
| 548 | + if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { |
| 549 | + throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL); |
| 550 | + } |
| 551 | + |
| 552 | + // Set whether the message is multipart/alternative |
| 553 | + if(!empty($this->AltBody)) { |
| 554 | + $this->ContentType = 'multipart/alternative'; |
| 555 | + } |
| 556 | + |
| 557 | + $this->error_count = 0; // reset errors |
| 558 | + $this->SetMessageType(); |
| 559 | + $header = $this->CreateHeader(); |
| 560 | + $body = $this->CreateBody(); |
| 561 | + |
| 562 | + if (empty($this->Body)) { |
| 563 | + throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL); |
| 564 | + } |
| 565 | + |
| 566 | + // digitally sign with DKIM if enabled |
| 567 | + if ($this->DKIM_domain && $this->DKIM_private) { |
| 568 | + $header_dkim = $this->DKIM_Add($header,$this->Subject,$body); |
| 569 | + $header = str_replace("\r\n","\n",$header_dkim) . $header; |
| 570 | + } |
| 571 | + |
| 572 | + // Choose the mailer and send through it |
| 573 | + switch($this->Mailer) { |
| 574 | + case 'sendmail': |
| 575 | + return $this->SendmailSend($header, $body); |
| 576 | + case 'smtp': |
| 577 | + return $this->SmtpSend($header, $body); |
| 578 | + default: |
| 579 | + return $this->MailSend($header, $body); |
| 580 | + } |
| 581 | + |
| 582 | + } catch (phpmailerException $e) { |
| 583 | + $this->SetError($e->getMessage()); |
| 584 | + if ($this->exceptions) { |
| 585 | + throw $e; |
| 586 | + } |
| 587 | + echo $e->getMessage()."\n"; |
| 588 | + return false; |
| 589 | + } |
| 590 | + } |
| 591 | + |
| 592 | + /** |
| 593 | + * Sends mail using the $Sendmail program. |
| 594 | + * @param string $header The message headers |
| 595 | + * @param string $body The message body |
| 596 | + * @access protected |
| 597 | + * @return bool |
| 598 | + */ |
| 599 | + protected function SendmailSend($header, $body) { |
| 600 | + if ($this->Sender != '') { |
| 601 | + $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender)); |
| 602 | + } else { |
| 603 | + $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail)); |
| 604 | + } |
| 605 | + if ($this->SingleTo === true) { |
| 606 | + foreach ($this->SingleToArray as $key => $val) { |
| 607 | + if(!@$mail = popen($sendmail, 'w')) { |
| 608 | + throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
| 609 | + } |
| 610 | + fputs($mail, "To: " . $val . "\n"); |
| 611 | + fputs($mail, $header); |
| 612 | + fputs($mail, $body); |
| 613 | + $result = pclose($mail); |
| 614 | + // implement call back function if it exists |
| 615 | + $isSent = ($result == 0) ? 1 : 0; |
| 616 | + $this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body); |
| 617 | + if($result != 0) { |
| 618 | + throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
| 619 | + } |
| 620 | + } |
| 621 | + } else { |
| 622 | + if(!@$mail = popen($sendmail, 'w')) { |
| 623 | + throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
| 624 | + } |
| 625 | + fputs($mail, $header); |
| 626 | + fputs($mail, $body); |
| 627 | + $result = pclose($mail); |
| 628 | + // implement call back function if it exists |
| 629 | + $isSent = ($result == 0) ? 1 : 0; |
| 630 | + $this->doCallback($isSent,$this->to,$this->cc,$this->bcc,$this->Subject,$body); |
| 631 | + if($result != 0) { |
| 632 | + throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
| 633 | + } |
| 634 | + } |
| 635 | + return true; |
| 636 | + } |
| 637 | + |
| 638 | + /** |
| 639 | + * Sends mail using the PHP mail() function. |
| 640 | + * @param string $header The message headers |
| 641 | + * @param string $body The message body |
| 642 | + * @access protected |
| 643 | + * @return bool |
| 644 | + */ |
| 645 | + protected function MailSend($header, $body) { |
| 646 | + $toArr = array(); |
| 647 | + foreach($this->to as $t) { |
| 648 | + $toArr[] = $this->AddrFormat($t); |
| 649 | + } |
| 650 | + $to = implode(', ', $toArr); |
| 651 | + |
| 652 | + $params = sprintf("-oi -f %s", $this->Sender); |
| 653 | + if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) { |
| 654 | + $old_from = ini_get('sendmail_from'); |
| 655 | + ini_set('sendmail_from', $this->Sender); |
| 656 | + if ($this->SingleTo === true && count($toArr) > 1) { |
| 657 | + foreach ($toArr as $key => $val) { |
| 658 | + $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); |
| 659 | + // implement call back function if it exists |
| 660 | + $isSent = ($rt == 1) ? 1 : 0; |
| 661 | + $this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body); |
| 662 | + } |
| 663 | + } else { |
| 664 | + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); |
| 665 | + // implement call back function if it exists |
| 666 | + $isSent = ($rt == 1) ? 1 : 0; |
| 667 | + $this->doCallback($isSent,$to,$this->cc,$this->bcc,$this->Subject,$body); |
| 668 | + } |
| 669 | + } else { |
| 670 | + if ($this->SingleTo === true && count($toArr) > 1) { |
| 671 | + foreach ($toArr as $key => $val) { |
| 672 | + $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); |
| 673 | + // implement call back function if it exists |
| 674 | + $isSent = ($rt == 1) ? 1 : 0; |
| 675 | + $this->doCallback($isSent,$val,$this->cc,$this->bcc,$this->Subject,$body); |
| 676 | + } |
| 677 | + } else { |
| 678 | + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); |
| 679 | + // implement call back function if it exists |
| 680 | + $isSent = ($rt == 1) ? 1 : 0; |
| 681 | + $this->doCallback($isSent,$to,$this->cc,$this->bcc,$this->Subject,$body); |
| 682 | + } |
| 683 | + } |
| 684 | + if (isset($old_from)) { |
| 685 | + ini_set('sendmail_from', $old_from); |
| 686 | + } |
| 687 | + if(!$rt) { |
| 688 | + throw new phpmailerException($this->Lang('instantiate'), self::STOP_CRITICAL); |
| 689 | + } |
| 690 | + return true; |
| 691 | + } |
| 692 | + |
| 693 | + /** |
| 694 | + * Sends mail via SMTP using PhpSMTP |
| 695 | + * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. |
| 696 | + * @param string $header The message headers |
| 697 | + * @param string $body The message body |
| 698 | + * @uses SMTP |
| 699 | + * @access protected |
| 700 | + * @return bool |
| 701 | + */ |
| 702 | + protected function SmtpSend($header, $body) { |
| 703 | + require_once $this->PluginDir . 'class.smtp.php'; |
| 704 | + $bad_rcpt = array(); |
| 705 | + |
| 706 | + if(!$this->SmtpConnect()) { |
| 707 | + throw new phpmailerException($this->Lang('smtp_connect_failed'), self::STOP_CRITICAL); |
| 708 | + } |
| 709 | + $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; |
| 710 | + if(!$this->smtp->Mail($smtp_from)) { |
| 711 | + throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL); |
| 712 | + } |
| 713 | + |
| 714 | + // Attempt to send attach all recipients |
| 715 | + foreach($this->to as $to) { |
| 716 | + if (!$this->smtp->Recipient($to[0])) { |
| 717 | + $bad_rcpt[] = $to[0]; |
| 718 | + // implement call back function if it exists |
| 719 | + $isSent = 0; |
| 720 | + $this->doCallback($isSent,$to[0],'','',$this->Subject,$body); |
| 721 | + } else { |
| 722 | + // implement call back function if it exists |
| 723 | + $isSent = 1; |
| 724 | + $this->doCallback($isSent,$to[0],'','',$this->Subject,$body); |
| 725 | + } |
| 726 | + } |
| 727 | + foreach($this->cc as $cc) { |
| 728 | + if (!$this->smtp->Recipient($cc[0])) { |
| 729 | + $bad_rcpt[] = $cc[0]; |
| 730 | + // implement call back function if it exists |
| 731 | + $isSent = 0; |
| 732 | + $this->doCallback($isSent,'',$cc[0],'',$this->Subject,$body); |
| 733 | + } else { |
| 734 | + // implement call back function if it exists |
| 735 | + $isSent = 1; |
| 736 | + $this->doCallback($isSent,'',$cc[0],'',$this->Subject,$body); |
| 737 | + } |
| 738 | + } |
| 739 | + foreach($this->bcc as $bcc) { |
| 740 | + if (!$this->smtp->Recipient($bcc[0])) { |
| 741 | + $bad_rcpt[] = $bcc[0]; |
| 742 | + // implement call back function if it exists |
| 743 | + $isSent = 0; |
| 744 | + $this->doCallback($isSent,'','',$bcc[0],$this->Subject,$body); |
| 745 | + } else { |
| 746 | + // implement call back function if it exists |
| 747 | + $isSent = 1; |
| 748 | + $this->doCallback($isSent,'','',$bcc[0],$this->Subject,$body); |
| 749 | + } |
| 750 | + } |
| 751 | + |
| 752 | + |
| 753 | + if (count($bad_rcpt) > 0 ) { //Create error message for any bad addresses |
| 754 | + $badaddresses = implode(', ', $bad_rcpt); |
| 755 | + throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses); |
| 756 | + } |
| 757 | + if(!$this->smtp->Data($header . $body)) { |
| 758 | + throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL); |
| 759 | + } |
| 760 | + if($this->SMTPKeepAlive == true) { |
| 761 | + $this->smtp->Reset(); |
| 762 | + } |
| 763 | + return true; |
| 764 | + } |
| 765 | + |
| 766 | + /** |
| 767 | + * Initiates a connection to an SMTP server. |
| 768 | + * Returns false if the operation failed. |
| 769 | + * @uses SMTP |
| 770 | + * @access public |
| 771 | + * @return bool |
| 772 | + */ |
| 773 | + public function SmtpConnect() { |
| 774 | + if(is_null($this->smtp)) { |
| 775 | + $this->smtp = new SMTP(); |
| 776 | + } |
| 777 | + |
| 778 | + $this->smtp->do_debug = $this->SMTPDebug; |
| 779 | + $hosts = explode(';', $this->Host); |
| 780 | + $index = 0; |
| 781 | + $connection = $this->smtp->Connected(); |
| 782 | + |
| 783 | + // Retry while there is no connection |
| 784 | + try { |
| 785 | + while($index < count($hosts) && !$connection) { |
| 786 | + $hostinfo = array(); |
| 787 | + if (preg_match('/^(.+):([0-9]+)$/', $hosts[$index], $hostinfo)) { |
| 788 | + $host = $hostinfo[1]; |
| 789 | + $port = $hostinfo[2]; |
| 790 | + } else { |
| 791 | + $host = $hosts[$index]; |
| 792 | + $port = $this->Port; |
| 793 | + } |
| 794 | + |
| 795 | + $tls = ($this->SMTPSecure == 'tls'); |
| 796 | + $ssl = ($this->SMTPSecure == 'ssl'); |
| 797 | + |
| 798 | + if ($this->smtp->Connect(($ssl ? 'ssl://':'').$host, $port, $this->Timeout)) { |
| 799 | + |
| 800 | + $hello = ($this->Helo != '' ? $this->Helo : $this->ServerHostname()); |
| 801 | + $this->smtp->Hello($hello); |
| 802 | + |
| 803 | + if ($tls) { |
| 804 | + if (!$this->smtp->StartTLS()) { |
| 805 | + throw new phpmailerException($this->Lang('tls')); |
| 806 | + } |
| 807 | + |
| 808 | + //We must resend HELO after tls negotiation |
| 809 | + $this->smtp->Hello($hello); |
| 810 | + } |
| 811 | + |
| 812 | + $connection = true; |
| 813 | + if ($this->SMTPAuth) { |
| 814 | + if (!$this->smtp->Authenticate($this->Username, $this->Password)) { |
| 815 | + throw new phpmailerException($this->Lang('authenticate')); |
| 816 | + } |
| 817 | + } |
| 818 | + } |
| 819 | + $index++; |
| 820 | + if (!$connection) { |
| 821 | + throw new phpmailerException($this->Lang('connect_host')); |
| 822 | + } |
| 823 | + } |
| 824 | + } catch (phpmailerException $e) { |
| 825 | + $this->smtp->Reset(); |
| 826 | + throw $e; |
| 827 | + } |
| 828 | + return true; |
| 829 | + } |
| 830 | + |
| 831 | + /** |
| 832 | + * Closes the active SMTP session if one exists. |
| 833 | + * @return void |
| 834 | + */ |
| 835 | + public function SmtpClose() { |
| 836 | + if(!is_null($this->smtp)) { |
| 837 | + if($this->smtp->Connected()) { |
| 838 | + $this->smtp->Quit(); |
| 839 | + $this->smtp->Close(); |
| 840 | + } |
| 841 | + } |
| 842 | + } |
| 843 | + |
| 844 | + /** |
| 845 | + * Sets the language for all class error messages. |
| 846 | + * Returns false if it cannot load the language file. The default language is English. |
| 847 | + * @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br") |
| 848 | + * @param string $lang_path Path to the language file directory |
| 849 | + * @access public |
| 850 | + */ |
| 851 | + function SetLanguage($langcode = 'en', $lang_path = 'language/') { |
| 852 | + //Define full set of translatable strings |
| 853 | + $PHPMAILER_LANG = array( |
| 854 | + 'provide_address' => 'You must provide at least one recipient email address.', |
| 855 | + 'mailer_not_supported' => ' mailer is not supported.', |
| 856 | + 'execute' => 'Could not execute: ', |
| 857 | + 'instantiate' => 'Could not instantiate mail function.', |
| 858 | + 'authenticate' => 'SMTP Error: Could not authenticate.', |
| 859 | + 'from_failed' => 'The following From address failed: ', |
| 860 | + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', |
| 861 | + 'data_not_accepted' => 'SMTP Error: Data not accepted.', |
| 862 | + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', |
| 863 | + 'file_access' => 'Could not access file: ', |
| 864 | + 'file_open' => 'File Error: Could not open file: ', |
| 865 | + 'encoding' => 'Unknown encoding: ', |
| 866 | + 'signing' => 'Signing Error: ', |
| 867 | + 'smtp_error' => 'SMTP server error: ', |
| 868 | + 'empty_message' => 'Message body empty', |
| 869 | + 'invalid_address' => 'Invalid address', |
| 870 | + 'variable_set' => 'Cannot set or reset variable: ' |
| 871 | + ); |
| 872 | + //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"! |
| 873 | + $l = true; |
| 874 | + if ($langcode != 'en') { //There is no English translation file |
| 875 | + $l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php'; |
| 876 | + } |
| 877 | + $this->language = $PHPMAILER_LANG; |
| 878 | + return ($l == true); //Returns false if language not found |
| 879 | + } |
| 880 | + |
| 881 | + /** |
| 882 | + * Return the current array of language strings |
| 883 | + * @return array |
| 884 | + */ |
| 885 | + public function GetTranslations() { |
| 886 | + return $this->language; |
| 887 | + } |
| 888 | + |
| 889 | + ///////////////////////////////////////////////// |
| 890 | + // METHODS, MESSAGE CREATION |
| 891 | + ///////////////////////////////////////////////// |
| 892 | + |
| 893 | + /** |
| 894 | + * Creates recipient headers. |
| 895 | + * @access public |
| 896 | + * @return string |
| 897 | + */ |
| 898 | + public function AddrAppend($type, $addr) { |
| 899 | + $addr_str = $type . ': '; |
| 900 | + $addresses = array(); |
| 901 | + foreach ($addr as $a) { |
| 902 | + $addresses[] = $this->AddrFormat($a); |
| 903 | + } |
| 904 | + $addr_str .= implode(', ', $addresses); |
| 905 | + $addr_str .= $this->LE; |
| 906 | + |
| 907 | + return $addr_str; |
| 908 | + } |
| 909 | + |
| 910 | + /** |
| 911 | + * Formats an address correctly. |
| 912 | + * @access public |
| 913 | + * @return string |
| 914 | + */ |
| 915 | + public function AddrFormat($addr) { |
| 916 | + if (empty($addr[1])) { |
| 917 | + return $this->SecureHeader($addr[0]); |
| 918 | + } else { |
| 919 | + return $this->EncodeHeader($this->SecureHeader($addr[1]), 'phrase') . " <" . $this->SecureHeader($addr[0]) . ">"; |
| 920 | + } |
| 921 | + } |
| 922 | + |
| 923 | + /** |
| 924 | + * Wraps message for use with mailers that do not |
| 925 | + * automatically perform wrapping and for quoted-printable. |
| 926 | + * Original written by philippe. |
| 927 | + * @param string $message The message to wrap |
| 928 | + * @param integer $length The line length to wrap to |
| 929 | + * @param boolean $qp_mode Whether to run in Quoted-Printable mode |
| 930 | + * @access public |
| 931 | + * @return string |
| 932 | + */ |
| 933 | + public function WrapText($message, $length, $qp_mode = false) { |
| 934 | + $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) : $this->LE; |
| 935 | + // If utf-8 encoding is used, we will need to make sure we don't |
| 936 | + // split multibyte characters when we wrap |
| 937 | + $is_utf8 = (strtolower($this->CharSet) == "utf-8"); |
| 938 | + |
| 939 | + $message = $this->FixEOL($message); |
| 940 | + if (substr($message, -1) == $this->LE) { |
| 941 | + $message = substr($message, 0, -1); |
| 942 | + } |
| 943 | + |
| 944 | + $line = explode($this->LE, $message); |
| 945 | + $message = ''; |
| 946 | + for ($i=0 ;$i < count($line); $i++) { |
| 947 | + $line_part = explode(' ', $line[$i]); |
| 948 | + $buf = ''; |
| 949 | + for ($e = 0; $e<count($line_part); $e++) { |
| 950 | + $word = $line_part[$e]; |
| 951 | + if ($qp_mode and (strlen($word) > $length)) { |
| 952 | + $space_left = $length - strlen($buf) - 1; |
| 953 | + if ($e != 0) { |
| 954 | + if ($space_left > 20) { |
| 955 | + $len = $space_left; |
| 956 | + if ($is_utf8) { |
| 957 | + $len = $this->UTF8CharBoundary($word, $len); |
| 958 | + } elseif (substr($word, $len - 1, 1) == "=") { |
| 959 | + $len--; |
| 960 | + } elseif (substr($word, $len - 2, 1) == "=") { |
| 961 | + $len -= 2; |
| 962 | + } |
| 963 | + $part = substr($word, 0, $len); |
| 964 | + $word = substr($word, $len); |
| 965 | + $buf .= ' ' . $part; |
| 966 | + $message .= $buf . sprintf("=%s", $this->LE); |
| 967 | + } else { |
| 968 | + $message .= $buf . $soft_break; |
| 969 | + } |
| 970 | + $buf = ''; |
| 971 | + } |
| 972 | + while (strlen($word) > 0) { |
| 973 | + $len = $length; |
| 974 | + if ($is_utf8) { |
| 975 | + $len = $this->UTF8CharBoundary($word, $len); |
| 976 | + } elseif (substr($word, $len - 1, 1) == "=") { |
| 977 | + $len--; |
| 978 | + } elseif (substr($word, $len - 2, 1) == "=") { |
| 979 | + $len -= 2; |
| 980 | + } |
| 981 | + $part = substr($word, 0, $len); |
| 982 | + $word = substr($word, $len); |
| 983 | + |
| 984 | + if (strlen($word) > 0) { |
| 985 | + $message .= $part . sprintf("=%s", $this->LE); |
| 986 | + } else { |
| 987 | + $buf = $part; |
| 988 | + } |
| 989 | + } |
| 990 | + } else { |
| 991 | + $buf_o = $buf; |
| 992 | + $buf .= ($e == 0) ? $word : (' ' . $word); |
| 993 | + |
| 994 | + if (strlen($buf) > $length and $buf_o != '') { |
| 995 | + $message .= $buf_o . $soft_break; |
| 996 | + $buf = $word; |
| 997 | + } |
| 998 | + } |
| 999 | + } |
| 1000 | + $message .= $buf . $this->LE; |
| 1001 | + } |
| 1002 | + |
| 1003 | + return $message; |
| 1004 | + } |
| 1005 | + |
| 1006 | + /** |
| 1007 | + * Finds last character boundary prior to maxLength in a utf-8 |
| 1008 | + * quoted (printable) encoded string. |
| 1009 | + * Original written by Colin Brown. |
| 1010 | + * @access public |
| 1011 | + * @param string $encodedText utf-8 QP text |
| 1012 | + * @param int $maxLength find last character boundary prior to this length |
| 1013 | + * @return int |
| 1014 | + */ |
| 1015 | + public function UTF8CharBoundary($encodedText, $maxLength) { |
| 1016 | + $foundSplitPos = false; |
| 1017 | + $lookBack = 3; |
| 1018 | + while (!$foundSplitPos) { |
| 1019 | + $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); |
| 1020 | + $encodedCharPos = strpos($lastChunk, "="); |
| 1021 | + if ($encodedCharPos !== false) { |
| 1022 | + // Found start of encoded character byte within $lookBack block. |
| 1023 | + // Check the encoded byte value (the 2 chars after the '=') |
| 1024 | + $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); |
| 1025 | + $dec = hexdec($hex); |
| 1026 | + if ($dec < 128) { // Single byte character. |
| 1027 | + // If the encoded char was found at pos 0, it will fit |
| 1028 | + // otherwise reduce maxLength to start of the encoded char |
| 1029 | + $maxLength = ($encodedCharPos == 0) ? $maxLength : |
| 1030 | + $maxLength - ($lookBack - $encodedCharPos); |
| 1031 | + $foundSplitPos = true; |
| 1032 | + } elseif ($dec >= 192) { // First byte of a multi byte character |
| 1033 | + // Reduce maxLength to split at start of character |
| 1034 | + $maxLength = $maxLength - ($lookBack - $encodedCharPos); |
| 1035 | + $foundSplitPos = true; |
| 1036 | + } elseif ($dec < 192) { // Middle byte of a multi byte character, look further back |
| 1037 | + $lookBack += 3; |
| 1038 | + } |
| 1039 | + } else { |
| 1040 | + // No encoded character found |
| 1041 | + $foundSplitPos = true; |
| 1042 | + } |
| 1043 | + } |
| 1044 | + return $maxLength; |
| 1045 | + } |
| 1046 | + |
| 1047 | + |
| 1048 | + /** |
| 1049 | + * Set the body wrapping. |
| 1050 | + * @access public |
| 1051 | + * @return void |
| 1052 | + */ |
| 1053 | + public function SetWordWrap() { |
| 1054 | + if($this->WordWrap < 1) { |
| 1055 | + return; |
| 1056 | + } |
| 1057 | + |
| 1058 | + switch($this->message_type) { |
| 1059 | + case 'alt': |
| 1060 | + case 'alt_attachments': |
| 1061 | + $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap); |
| 1062 | + break; |
| 1063 | + default: |
| 1064 | + $this->Body = $this->WrapText($this->Body, $this->WordWrap); |
| 1065 | + break; |
| 1066 | + } |
| 1067 | + } |
| 1068 | + |
| 1069 | + /** |
| 1070 | + * Assembles message header. |
| 1071 | + * @access public |
| 1072 | + * @return string The assembled header |
| 1073 | + */ |
| 1074 | + public function CreateHeader() { |
| 1075 | + $result = ''; |
| 1076 | + |
| 1077 | + // Set the boundaries |
| 1078 | + $uniq_id = md5(uniqid(time())); |
| 1079 | + $this->boundary[1] = 'b1_' . $uniq_id; |
| 1080 | + $this->boundary[2] = 'b2_' . $uniq_id; |
| 1081 | + |
| 1082 | + $result .= $this->HeaderLine('Date', self::RFCDate()); |
| 1083 | + if($this->Sender == '') { |
| 1084 | + $result .= $this->HeaderLine('Return-Path', trim($this->From)); |
| 1085 | + } else { |
| 1086 | + $result .= $this->HeaderLine('Return-Path', trim($this->Sender)); |
| 1087 | + } |
| 1088 | + |
| 1089 | + // To be created automatically by mail() |
| 1090 | + if($this->Mailer != 'mail') { |
| 1091 | + if ($this->SingleTo === true) { |
| 1092 | + foreach($this->to as $t) { |
| 1093 | + $this->SingleToArray[] = $this->AddrFormat($t); |
| 1094 | + } |
| 1095 | + } else { |
| 1096 | + if(count($this->to) > 0) { |
| 1097 | + $result .= $this->AddrAppend('To', $this->to); |
| 1098 | + } elseif (count($this->cc) == 0) { |
| 1099 | + $result .= $this->HeaderLine('To', 'undisclosed-recipients:;'); |
| 1100 | + } |
| 1101 | + } |
| 1102 | + } |
| 1103 | + |
| 1104 | + $from = array(); |
| 1105 | + $from[0][0] = trim($this->From); |
| 1106 | + $from[0][1] = $this->FromName; |
| 1107 | + $result .= $this->AddrAppend('From', $from); |
| 1108 | + |
| 1109 | + // sendmail and mail() extract Cc from the header before sending |
| 1110 | + if(count($this->cc) > 0) { |
| 1111 | + $result .= $this->AddrAppend('Cc', $this->cc); |
| 1112 | + } |
| 1113 | + |
| 1114 | + // sendmail and mail() extract Bcc from the header before sending |
| 1115 | + if((($this->Mailer == 'sendmail') || ($this->Mailer == 'mail')) && (count($this->bcc) > 0)) { |
| 1116 | + $result .= $this->AddrAppend('Bcc', $this->bcc); |
| 1117 | + } |
| 1118 | + |
| 1119 | + if(count($this->ReplyTo) > 0) { |
| 1120 | + $result .= $this->AddrAppend('Reply-to', $this->ReplyTo); |
| 1121 | + } |
| 1122 | + |
| 1123 | + // mail() sets the subject itself |
| 1124 | + if($this->Mailer != 'mail') { |
| 1125 | + $result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject))); |
| 1126 | + } |
| 1127 | + |
| 1128 | + if($this->MessageID != '') { |
| 1129 | + $result .= $this->HeaderLine('Message-ID',$this->MessageID); |
| 1130 | + } else { |
| 1131 | + $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); |
| 1132 | + } |
| 1133 | + $result .= $this->HeaderLine('X-Priority', $this->Priority); |
| 1134 | + $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (phpmailer.sourceforge.net)'); |
| 1135 | + |
| 1136 | + if($this->ConfirmReadingTo != '') { |
| 1137 | + $result .= $this->HeaderLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>'); |
| 1138 | + } |
| 1139 | + |
| 1140 | + // Add custom headers |
| 1141 | + for($index = 0; $index < count($this->CustomHeader); $index++) { |
| 1142 | + $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), $this->EncodeHeader(trim($this->CustomHeader[$index][1]))); |
| 1143 | + } |
| 1144 | + if (!$this->sign_key_file) { |
| 1145 | + $result .= $this->HeaderLine('MIME-Version', '1.0'); |
| 1146 | + $result .= $this->GetMailMIME(); |
| 1147 | + } |
| 1148 | + |
| 1149 | + return $result; |
| 1150 | + } |
| 1151 | + |
| 1152 | + /** |
| 1153 | + * Returns the message MIME. |
| 1154 | + * @access public |
| 1155 | + * @return string |
| 1156 | + */ |
| 1157 | + public function GetMailMIME() { |
| 1158 | + $result = ''; |
| 1159 | + switch($this->message_type) { |
| 1160 | + case 'plain': |
| 1161 | + $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding); |
| 1162 | + $result .= sprintf("Content-Type: %s; charset=\"%s\"", $this->ContentType, $this->CharSet); |
| 1163 | + break; |
| 1164 | + case 'attachments': |
| 1165 | + case 'alt_attachments': |
| 1166 | + if($this->InlineImageExists()){ |
| 1167 | + $result .= sprintf("Content-Type: %s;%s\ttype=\"text/html\";%s\tboundary=\"%s\"%s", 'multipart/related', $this->LE, $this->LE, $this->boundary[1], $this->LE); |
| 1168 | + } else { |
| 1169 | + $result .= $this->HeaderLine('Content-Type', 'multipart/mixed;'); |
| 1170 | + $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); |
| 1171 | + } |
| 1172 | + break; |
| 1173 | + case 'alt': |
| 1174 | + $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;'); |
| 1175 | + $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"'); |
| 1176 | + break; |
| 1177 | + } |
| 1178 | + |
| 1179 | + if($this->Mailer != 'mail') { |
| 1180 | + $result .= $this->LE.$this->LE; |
| 1181 | + } |
| 1182 | + |
| 1183 | + return $result; |
| 1184 | + } |
| 1185 | + |
| 1186 | + /** |
| 1187 | + * Assembles the message body. Returns an empty string on failure. |
| 1188 | + * @access public |
| 1189 | + * @return string The assembled message body |
| 1190 | + */ |
| 1191 | + public function CreateBody() { |
| 1192 | + $body = ''; |
| 1193 | + |
| 1194 | + if ($this->sign_key_file) { |
| 1195 | + $body .= $this->GetMailMIME(); |
| 1196 | + } |
| 1197 | + |
| 1198 | + $this->SetWordWrap(); |
| 1199 | + |
| 1200 | + switch($this->message_type) { |
| 1201 | + case 'alt': |
| 1202 | + $body .= $this->GetBoundary($this->boundary[1], '', 'text/plain', ''); |
| 1203 | + $body .= $this->EncodeString($this->AltBody, $this->Encoding); |
| 1204 | + $body .= $this->LE.$this->LE; |
| 1205 | + $body .= $this->GetBoundary($this->boundary[1], '', 'text/html', ''); |
| 1206 | + $body .= $this->EncodeString($this->Body, $this->Encoding); |
| 1207 | + $body .= $this->LE.$this->LE; |
| 1208 | + $body .= $this->EndBoundary($this->boundary[1]); |
| 1209 | + break; |
| 1210 | + case 'plain': |
| 1211 | + $body .= $this->EncodeString($this->Body, $this->Encoding); |
| 1212 | + break; |
| 1213 | + case 'attachments': |
| 1214 | + $body .= $this->GetBoundary($this->boundary[1], '', '', ''); |
| 1215 | + $body .= $this->EncodeString($this->Body, $this->Encoding); |
| 1216 | + $body .= $this->LE; |
| 1217 | + $body .= $this->AttachAll(); |
| 1218 | + break; |
| 1219 | + case 'alt_attachments': |
| 1220 | + $body .= sprintf("--%s%s", $this->boundary[1], $this->LE); |
| 1221 | + $body .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE); |
| 1222 | + $body .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body |
| 1223 | + $body .= $this->EncodeString($this->AltBody, $this->Encoding); |
| 1224 | + $body .= $this->LE.$this->LE; |
| 1225 | + $body .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body |
| 1226 | + $body .= $this->EncodeString($this->Body, $this->Encoding); |
| 1227 | + $body .= $this->LE.$this->LE; |
| 1228 | + $body .= $this->EndBoundary($this->boundary[2]); |
| 1229 | + $body .= $this->AttachAll(); |
| 1230 | + break; |
| 1231 | + } |
| 1232 | + |
| 1233 | + if ($this->IsError()) { |
| 1234 | + $body = ''; |
| 1235 | + } elseif ($this->sign_key_file) { |
| 1236 | + try { |
| 1237 | + $file = tempnam('', 'mail'); |
| 1238 | + file_put_contents($file, $body); //TODO check this worked |
| 1239 | + $signed = tempnam("", "signed"); |
| 1240 | + if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), NULL)) { |
| 1241 | + @unlink($file); |
| 1242 | + @unlink($signed); |
| 1243 | + $body = file_get_contents($signed); |
| 1244 | + } else { |
| 1245 | + @unlink($file); |
| 1246 | + @unlink($signed); |
| 1247 | + throw new phpmailerException($this->Lang("signing").openssl_error_string()); |
| 1248 | + } |
| 1249 | + } catch (phpmailerException $e) { |
| 1250 | + $body = ''; |
| 1251 | + if ($this->exceptions) { |
| 1252 | + throw $e; |
| 1253 | + } |
| 1254 | + } |
| 1255 | + } |
| 1256 | + |
| 1257 | + return $body; |
| 1258 | + } |
| 1259 | + |
| 1260 | + /** |
| 1261 | + * Returns the start of a message boundary. |
| 1262 | + * @access private |
| 1263 | + */ |
| 1264 | + private function GetBoundary($boundary, $charSet, $contentType, $encoding) { |
| 1265 | + $result = ''; |
| 1266 | + if($charSet == '') { |
| 1267 | + $charSet = $this->CharSet; |
| 1268 | + } |
| 1269 | + if($contentType == '') { |
| 1270 | + $contentType = $this->ContentType; |
| 1271 | + } |
| 1272 | + if($encoding == '') { |
| 1273 | + $encoding = $this->Encoding; |
| 1274 | + } |
| 1275 | + $result .= $this->TextLine('--' . $boundary); |
| 1276 | + $result .= sprintf("Content-Type: %s; charset = \"%s\"", $contentType, $charSet); |
| 1277 | + $result .= $this->LE; |
| 1278 | + $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding); |
| 1279 | + $result .= $this->LE; |
| 1280 | + |
| 1281 | + return $result; |
| 1282 | + } |
| 1283 | + |
| 1284 | + /** |
| 1285 | + * Returns the end of a message boundary. |
| 1286 | + * @access private |
| 1287 | + */ |
| 1288 | + private function EndBoundary($boundary) { |
| 1289 | + return $this->LE . '--' . $boundary . '--' . $this->LE; |
| 1290 | + } |
| 1291 | + |
| 1292 | + /** |
| 1293 | + * Sets the message type. |
| 1294 | + * @access private |
| 1295 | + * @return void |
| 1296 | + */ |
| 1297 | + private function SetMessageType() { |
| 1298 | + if(count($this->attachment) < 1 && strlen($this->AltBody) < 1) { |
| 1299 | + $this->message_type = 'plain'; |
| 1300 | + } else { |
| 1301 | + if(count($this->attachment) > 0) { |
| 1302 | + $this->message_type = 'attachments'; |
| 1303 | + } |
| 1304 | + if(strlen($this->AltBody) > 0 && count($this->attachment) < 1) { |
| 1305 | + $this->message_type = 'alt'; |
| 1306 | + } |
| 1307 | + if(strlen($this->AltBody) > 0 && count($this->attachment) > 0) { |
| 1308 | + $this->message_type = 'alt_attachments'; |
| 1309 | + } |
| 1310 | + } |
| 1311 | + } |
| 1312 | + |
| 1313 | + /** |
| 1314 | + * Returns a formatted header line. |
| 1315 | + * @access public |
| 1316 | + * @return string |
| 1317 | + */ |
| 1318 | + public function HeaderLine($name, $value) { |
| 1319 | + return $name . ': ' . $value . $this->LE; |
| 1320 | + } |
| 1321 | + |
| 1322 | + /** |
| 1323 | + * Returns a formatted mail line. |
| 1324 | + * @access public |
| 1325 | + * @return string |
| 1326 | + */ |
| 1327 | + public function TextLine($value) { |
| 1328 | + return $value . $this->LE; |
| 1329 | + } |
| 1330 | + |
| 1331 | + ///////////////////////////////////////////////// |
| 1332 | + // CLASS METHODS, ATTACHMENTS |
| 1333 | + ///////////////////////////////////////////////// |
| 1334 | + |
| 1335 | + /** |
| 1336 | + * Adds an attachment from a path on the filesystem. |
| 1337 | + * Returns false if the file could not be found |
| 1338 | + * or accessed. |
| 1339 | + * @param string $path Path to the attachment. |
| 1340 | + * @param string $name Overrides the attachment name. |
| 1341 | + * @param string $encoding File encoding (see $Encoding). |
| 1342 | + * @param string $type File extension (MIME) type. |
| 1343 | + * @return bool |
| 1344 | + */ |
| 1345 | + public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { |
| 1346 | + try { |
| 1347 | + if ( !@is_file($path) ) { |
| 1348 | + throw new phpmailerException($this->Lang('file_access') . $path, self::STOP_CONTINUE); |
| 1349 | + } |
| 1350 | + $filename = basename($path); |
| 1351 | + if ( $name == '' ) { |
| 1352 | + $name = $filename; |
| 1353 | + } |
| 1354 | + |
| 1355 | + $this->attachment[] = array( |
| 1356 | + 0 => $path, |
| 1357 | + 1 => $filename, |
| 1358 | + 2 => $name, |
| 1359 | + 3 => $encoding, |
| 1360 | + 4 => $type, |
| 1361 | + 5 => false, // isStringAttachment |
| 1362 | + 6 => 'attachment', |
| 1363 | + 7 => 0 |
| 1364 | + ); |
| 1365 | + |
| 1366 | + } catch (phpmailerException $e) { |
| 1367 | + $this->SetError($e->getMessage()); |
| 1368 | + if ($this->exceptions) { |
| 1369 | + throw $e; |
| 1370 | + } |
| 1371 | + echo $e->getMessage()."\n"; |
| 1372 | + if ( $e->getCode() == self::STOP_CRITICAL ) { |
| 1373 | + return false; |
| 1374 | + } |
| 1375 | + } |
| 1376 | + return true; |
| 1377 | + } |
| 1378 | + |
| 1379 | + /** |
| 1380 | + * Return the current array of attachments |
| 1381 | + * @return array |
| 1382 | + */ |
| 1383 | + public function GetAttachments() { |
| 1384 | + return $this->attachment; |
| 1385 | + } |
| 1386 | + |
| 1387 | + /** |
| 1388 | + * Attaches all fs, string, and binary attachments to the message. |
| 1389 | + * Returns an empty string on failure. |
| 1390 | + * @access private |
| 1391 | + * @return string |
| 1392 | + */ |
| 1393 | + private function AttachAll() { |
| 1394 | + // Return text of body |
| 1395 | + $mime = array(); |
| 1396 | + $cidUniq = array(); |
| 1397 | + $incl = array(); |
| 1398 | + |
| 1399 | + // Add all attachments |
| 1400 | + foreach ($this->attachment as $attachment) { |
| 1401 | + // Check for string attachment |
| 1402 | + $bString = $attachment[5]; |
| 1403 | + if ($bString) { |
| 1404 | + $string = $attachment[0]; |
| 1405 | + } else { |
| 1406 | + $path = $attachment[0]; |
| 1407 | + } |
| 1408 | + |
| 1409 | + if (in_array($attachment[0], $incl)) { continue; } |
| 1410 | + $filename = $attachment[1]; |
| 1411 | + $name = $attachment[2]; |
| 1412 | + $encoding = $attachment[3]; |
| 1413 | + $type = $attachment[4]; |
| 1414 | + $disposition = $attachment[6]; |
| 1415 | + $cid = $attachment[7]; |
| 1416 | + $incl[] = $attachment[0]; |
| 1417 | + if ( $disposition == 'inline' && isset($cidUniq[$cid]) ) { continue; } |
| 1418 | + $cidUniq[$cid] = true; |
| 1419 | + |
| 1420 | + $mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE); |
| 1421 | + $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE); |
| 1422 | + $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE); |
| 1423 | + |
| 1424 | + if($disposition == 'inline') { |
| 1425 | + $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE); |
| 1426 | + } |
| 1427 | + |
| 1428 | + $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE); |
| 1429 | + |
| 1430 | + // Encode as string attachment |
| 1431 | + if($bString) { |
| 1432 | + $mime[] = $this->EncodeString($string, $encoding); |
| 1433 | + if($this->IsError()) { |
| 1434 | + return ''; |
| 1435 | + } |
| 1436 | + $mime[] = $this->LE.$this->LE; |
| 1437 | + } else { |
| 1438 | + $mime[] = $this->EncodeFile($path, $encoding); |
| 1439 | + if($this->IsError()) { |
| 1440 | + return ''; |
| 1441 | + } |
| 1442 | + $mime[] = $this->LE.$this->LE; |
| 1443 | + } |
| 1444 | + } |
| 1445 | + |
| 1446 | + $mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE); |
| 1447 | + |
| 1448 | + return join('', $mime); |
| 1449 | + } |
| 1450 | + |
| 1451 | + /** |
| 1452 | + * Encodes attachment in requested format. |
| 1453 | + * Returns an empty string on failure. |
| 1454 | + * @param string $path The full path to the file |
| 1455 | + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' |
| 1456 | + * @see EncodeFile() |
| 1457 | + * @access private |
| 1458 | + * @return string |
| 1459 | + */ |
| 1460 | + private function EncodeFile($path, $encoding = 'base64') { |
| 1461 | + try { |
| 1462 | + if (!is_readable($path)) { |
| 1463 | + throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE); |
| 1464 | + } |
| 1465 | + if (function_exists('get_magic_quotes')) { |
| 1466 | + function get_magic_quotes() { |
| 1467 | + return false; |
| 1468 | + } |
| 1469 | + } |
| 1470 | + if (PHP_VERSION < 6) { |
| 1471 | + $magic_quotes = get_magic_quotes_runtime(); |
| 1472 | + set_magic_quotes_runtime(0); |
| 1473 | + } |
| 1474 | + $file_buffer = file_get_contents($path); |
| 1475 | + $file_buffer = $this->EncodeString($file_buffer, $encoding); |
| 1476 | + if (PHP_VERSION < 6) { set_magic_quotes_runtime($magic_quotes); } |
| 1477 | + return $file_buffer; |
| 1478 | + } catch (Exception $e) { |
| 1479 | + $this->SetError($e->getMessage()); |
| 1480 | + return ''; |
| 1481 | + } |
| 1482 | + } |
| 1483 | + |
| 1484 | + /** |
| 1485 | + * Encodes string to requested format. |
| 1486 | + * Returns an empty string on failure. |
| 1487 | + * @param string $str The text to encode |
| 1488 | + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' |
| 1489 | + * @access public |
| 1490 | + * @return string |
| 1491 | + */ |
| 1492 | + public function EncodeString ($str, $encoding = 'base64') { |
| 1493 | + $encoded = ''; |
| 1494 | + switch(strtolower($encoding)) { |
| 1495 | + case 'base64': |
| 1496 | + $encoded = chunk_split(base64_encode($str), 76, $this->LE); |
| 1497 | + break; |
| 1498 | + case '7bit': |
| 1499 | + case '8bit': |
| 1500 | + $encoded = $this->FixEOL($str); |
| 1501 | + //Make sure it ends with a line break |
| 1502 | + if (substr($encoded, -(strlen($this->LE))) != $this->LE) |
| 1503 | + $encoded .= $this->LE; |
| 1504 | + break; |
| 1505 | + case 'binary': |
| 1506 | + $encoded = $str; |
| 1507 | + break; |
| 1508 | + case 'quoted-printable': |
| 1509 | + $encoded = $this->EncodeQP($str); |
| 1510 | + break; |
| 1511 | + default: |
| 1512 | + $this->SetError($this->Lang('encoding') . $encoding); |
| 1513 | + break; |
| 1514 | + } |
| 1515 | + return $encoded; |
| 1516 | + } |
| 1517 | + |
| 1518 | + /** |
| 1519 | + * Encode a header string to best (shortest) of Q, B, quoted or none. |
| 1520 | + * @access public |
| 1521 | + * @return string |
| 1522 | + */ |
| 1523 | + public function EncodeHeader($str, $position = 'text') { |
| 1524 | + $x = 0; |
| 1525 | + |
| 1526 | + switch (strtolower($position)) { |
| 1527 | + case 'phrase': |
| 1528 | + if (!preg_match('/[\200-\377]/', $str)) { |
| 1529 | + // Can't use addslashes as we don't know what value has magic_quotes_sybase |
| 1530 | + $encoded = addcslashes($str, "\0..\37\177\\\""); |
| 1531 | + if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { |
| 1532 | + return ($encoded); |
| 1533 | + } else { |
| 1534 | + return ("\"$encoded\""); |
| 1535 | + } |
| 1536 | + } |
| 1537 | + $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); |
| 1538 | + break; |
| 1539 | + case 'comment': |
| 1540 | + $x = preg_match_all('/[()"]/', $str, $matches); |
| 1541 | + // Fall-through |
| 1542 | + case 'text': |
| 1543 | + default: |
| 1544 | + $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); |
| 1545 | + break; |
| 1546 | + } |
| 1547 | + |
| 1548 | + if ($x == 0) { |
| 1549 | + return ($str); |
| 1550 | + } |
| 1551 | + |
| 1552 | + $maxlen = 75 - 7 - strlen($this->CharSet); |
| 1553 | + // Try to select the encoding which should produce the shortest output |
| 1554 | + if (strlen($str)/3 < $x) { |
| 1555 | + $encoding = 'B'; |
| 1556 | + if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) { |
| 1557 | + // Use a custom function which correctly encodes and wraps long |
| 1558 | + // multibyte strings without breaking lines within a character |
| 1559 | + $encoded = $this->Base64EncodeWrapMB($str); |
| 1560 | + } else { |
| 1561 | + $encoded = base64_encode($str); |
| 1562 | + $maxlen -= $maxlen % 4; |
| 1563 | + $encoded = trim(chunk_split($encoded, $maxlen, "\n")); |
| 1564 | + } |
| 1565 | + } else { |
| 1566 | + $encoding = 'Q'; |
| 1567 | + $encoded = $this->EncodeQ($str, $position); |
| 1568 | + $encoded = $this->WrapText($encoded, $maxlen, true); |
| 1569 | + $encoded = str_replace('='.$this->LE, "\n", trim($encoded)); |
| 1570 | + } |
| 1571 | + |
| 1572 | + $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded); |
| 1573 | + $encoded = trim(str_replace("\n", $this->LE, $encoded)); |
| 1574 | + |
| 1575 | + return $encoded; |
| 1576 | + } |
| 1577 | + |
| 1578 | + /** |
| 1579 | + * Checks if a string contains multibyte characters. |
| 1580 | + * @access public |
| 1581 | + * @param string $str multi-byte text to wrap encode |
| 1582 | + * @return bool |
| 1583 | + */ |
| 1584 | + public function HasMultiBytes($str) { |
| 1585 | + if (function_exists('mb_strlen')) { |
| 1586 | + return (strlen($str) > mb_strlen($str, $this->CharSet)); |
| 1587 | + } else { // Assume no multibytes (we can't handle without mbstring functions anyway) |
| 1588 | + return false; |
| 1589 | + } |
| 1590 | + } |
| 1591 | + |
| 1592 | + /** |
| 1593 | + * Correctly encodes and wraps long multibyte strings for mail headers |
| 1594 | + * without breaking lines within a character. |
| 1595 | + * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php |
| 1596 | + * @access public |
| 1597 | + * @param string $str multi-byte text to wrap encode |
| 1598 | + * @return string |
| 1599 | + */ |
| 1600 | + public function Base64EncodeWrapMB($str) { |
| 1601 | + $start = "=?".$this->CharSet."?B?"; |
| 1602 | + $end = "?="; |
| 1603 | + $encoded = ""; |
| 1604 | + |
| 1605 | + $mb_length = mb_strlen($str, $this->CharSet); |
| 1606 | + // Each line must have length <= 75, including $start and $end |
| 1607 | + $length = 75 - strlen($start) - strlen($end); |
| 1608 | + // Average multi-byte ratio |
| 1609 | + $ratio = $mb_length / strlen($str); |
| 1610 | + // Base64 has a 4:3 ratio |
| 1611 | + $offset = $avgLength = floor($length * $ratio * .75); |
| 1612 | + |
| 1613 | + for ($i = 0; $i < $mb_length; $i += $offset) { |
| 1614 | + $lookBack = 0; |
| 1615 | + |
| 1616 | + do { |
| 1617 | + $offset = $avgLength - $lookBack; |
| 1618 | + $chunk = mb_substr($str, $i, $offset, $this->CharSet); |
| 1619 | + $chunk = base64_encode($chunk); |
| 1620 | + $lookBack++; |
| 1621 | + } |
| 1622 | + while (strlen($chunk) > $length); |
| 1623 | + |
| 1624 | + $encoded .= $chunk . $this->LE; |
| 1625 | + } |
| 1626 | + |
| 1627 | + // Chomp the last linefeed |
| 1628 | + $encoded = substr($encoded, 0, -strlen($this->LE)); |
| 1629 | + return $encoded; |
| 1630 | + } |
| 1631 | + |
| 1632 | + /** |
| 1633 | + * Encode string to quoted-printable. |
| 1634 | + * Only uses standard PHP, slow, but will always work |
| 1635 | + * @access public |
| 1636 | + * @param string $string the text to encode |
| 1637 | + * @param integer $line_max Number of chars allowed on a line before wrapping |
| 1638 | + * @return string |
| 1639 | + */ |
| 1640 | + public function EncodeQPphp( $input = '', $line_max = 76, $space_conv = false) { |
| 1641 | + $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); |
| 1642 | + $lines = preg_split('/(?:\r\n|\r|\n)/', $input); |
| 1643 | + $eol = "\r\n"; |
| 1644 | + $escape = '='; |
| 1645 | + $output = ''; |
| 1646 | + while( list(, $line) = each($lines) ) { |
| 1647 | + $linlen = strlen($line); |
| 1648 | + $newline = ''; |
| 1649 | + for($i = 0; $i < $linlen; $i++) { |
| 1650 | + $c = substr( $line, $i, 1 ); |
| 1651 | + $dec = ord( $c ); |
| 1652 | + if ( ( $i == 0 ) && ( $dec == 46 ) ) { // convert first point in the line into =2E |
| 1653 | + $c = '=2E'; |
| 1654 | + } |
| 1655 | + if ( $dec == 32 ) { |
| 1656 | + if ( $i == ( $linlen - 1 ) ) { // convert space at eol only |
| 1657 | + $c = '=20'; |
| 1658 | + } else if ( $space_conv ) { |
| 1659 | + $c = '=20'; |
| 1660 | + } |
| 1661 | + } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required |
| 1662 | + $h2 = floor($dec/16); |
| 1663 | + $h1 = floor($dec%16); |
| 1664 | + $c = $escape.$hex[$h2].$hex[$h1]; |
| 1665 | + } |
| 1666 | + if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted |
| 1667 | + $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay |
| 1668 | + $newline = ''; |
| 1669 | + // check if newline first character will be point or not |
| 1670 | + if ( $dec == 46 ) { |
| 1671 | + $c = '=2E'; |
| 1672 | + } |
| 1673 | + } |
| 1674 | + $newline .= $c; |
| 1675 | + } // end of for |
| 1676 | + $output .= $newline.$eol; |
| 1677 | + } // end of while |
| 1678 | + return $output; |
| 1679 | + } |
| 1680 | + |
| 1681 | + /** |
| 1682 | + * Encode string to RFC2045 (6.7) quoted-printable format |
| 1683 | + * Uses a PHP5 stream filter to do the encoding about 64x faster than the old version |
| 1684 | + * Also results in same content as you started with after decoding |
| 1685 | + * @see EncodeQPphp() |
| 1686 | + * @access public |
| 1687 | + * @param string $string the text to encode |
| 1688 | + * @param integer $line_max Number of chars allowed on a line before wrapping |
| 1689 | + * @param boolean $space_conv Dummy param for compatibility with existing EncodeQP function |
| 1690 | + * @return string |
| 1691 | + * @author Marcus Bointon |
| 1692 | + */ |
| 1693 | + public function EncodeQP($string, $line_max = 76, $space_conv = false) { |
| 1694 | + if (function_exists('quoted_printable_encode')) { //Use native function if it's available (>= PHP5.3) |
| 1695 | + return quoted_printable_encode($string); |
| 1696 | + } |
| 1697 | + $filters = stream_get_filters(); |
| 1698 | + if (!in_array('convert.*', $filters)) { //Got convert stream filter? |
| 1699 | + return $this->EncodeQPphp($string, $line_max, $space_conv); //Fall back to old implementation |
| 1700 | + } |
| 1701 | + $fp = fopen('php://temp/', 'r+'); |
| 1702 | + $string = preg_replace('/\r\n?/', $this->LE, $string); //Normalise line breaks |
| 1703 | + $params = array('line-length' => $line_max, 'line-break-chars' => $this->LE); |
| 1704 | + $s = stream_filter_append($fp, 'convert.quoted-printable-encode', STREAM_FILTER_READ, $params); |
| 1705 | + fputs($fp, $string); |
| 1706 | + rewind($fp); |
| 1707 | + $out = stream_get_contents($fp); |
| 1708 | + stream_filter_remove($s); |
| 1709 | + $out = preg_replace('/^\./m', '=2E', $out); //Encode . if it is first char on a line, workaround for bug in Exchange |
| 1710 | + fclose($fp); |
| 1711 | + return $out; |
| 1712 | + } |
| 1713 | + |
| 1714 | + /** |
| 1715 | + * Encode string to q encoding. |
| 1716 | + * @link http://tools.ietf.org/html/rfc2047 |
| 1717 | + * @param string $str the text to encode |
| 1718 | + * @param string $position Where the text is going to be used, see the RFC for what that means |
| 1719 | + * @access public |
| 1720 | + * @return string |
| 1721 | + */ |
| 1722 | + public function EncodeQ ($str, $position = 'text') { |
| 1723 | + // There should not be any EOL in the string |
| 1724 | + $encoded = preg_replace('/[\r\n]*/', '', $str); |
| 1725 | + |
| 1726 | + switch (strtolower($position)) { |
| 1727 | + case 'phrase': |
| 1728 | + $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); |
| 1729 | + break; |
| 1730 | + case 'comment': |
| 1731 | + $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); |
| 1732 | + case 'text': |
| 1733 | + default: |
| 1734 | + // Replace every high ascii, control =, ? and _ characters |
| 1735 | + //TODO using /e (equivalent to eval()) is probably not a good idea |
| 1736 | + $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', |
| 1737 | + "'='.sprintf('%02X', ord('\\1'))", $encoded); |
| 1738 | + break; |
| 1739 | + } |
| 1740 | + |
| 1741 | + // Replace every spaces to _ (more readable than =20) |
| 1742 | + $encoded = str_replace(' ', '_', $encoded); |
| 1743 | + |
| 1744 | + return $encoded; |
| 1745 | + } |
| 1746 | + |
| 1747 | + /** |
| 1748 | + * Adds a string or binary attachment (non-filesystem) to the list. |
| 1749 | + * This method can be used to attach ascii or binary data, |
| 1750 | + * such as a BLOB record from a database. |
| 1751 | + * @param string $string String attachment data. |
| 1752 | + * @param string $filename Name of the attachment. |
| 1753 | + * @param string $encoding File encoding (see $Encoding). |
| 1754 | + * @param string $type File extension (MIME) type. |
| 1755 | + * @return void |
| 1756 | + */ |
| 1757 | + public function AddStringAttachment($string, $filename, $encoding = 'base64', $type = 'application/octet-stream') { |
| 1758 | + // Append to $attachment array |
| 1759 | + $this->attachment[] = array( |
| 1760 | + 0 => $string, |
| 1761 | + 1 => $filename, |
| 1762 | + 2 => basename($filename), |
| 1763 | + 3 => $encoding, |
| 1764 | + 4 => $type, |
| 1765 | + 5 => true, // isStringAttachment |
| 1766 | + 6 => 'attachment', |
| 1767 | + 7 => 0 |
| 1768 | + ); |
| 1769 | + } |
| 1770 | + |
| 1771 | + /** |
| 1772 | + * Adds an embedded attachment. This can include images, sounds, and |
| 1773 | + * just about any other document. Make sure to set the $type to an |
| 1774 | + * image type. For JPEG images use "image/jpeg" and for GIF images |
| 1775 | + * use "image/gif". |
| 1776 | + * @param string $path Path to the attachment. |
| 1777 | + * @param string $cid Content ID of the attachment. Use this to identify |
| 1778 | + * the Id for accessing the image in an HTML form. |
| 1779 | + * @param string $name Overrides the attachment name. |
| 1780 | + * @param string $encoding File encoding (see $Encoding). |
| 1781 | + * @param string $type File extension (MIME) type. |
| 1782 | + * @return bool |
| 1783 | + */ |
| 1784 | + public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') { |
| 1785 | + |
| 1786 | + if ( !@is_file($path) ) { |
| 1787 | + $this->SetError($this->Lang('file_access') . $path); |
| 1788 | + return false; |
| 1789 | + } |
| 1790 | + |
| 1791 | + $filename = basename($path); |
| 1792 | + if ( $name == '' ) { |
| 1793 | + $name = $filename; |
| 1794 | + } |
| 1795 | + |
| 1796 | + // Append to $attachment array |
| 1797 | + $this->attachment[] = array( |
| 1798 | + 0 => $path, |
| 1799 | + 1 => $filename, |
| 1800 | + 2 => $name, |
| 1801 | + 3 => $encoding, |
| 1802 | + 4 => $type, |
| 1803 | + 5 => false, // isStringAttachment |
| 1804 | + 6 => 'inline', |
| 1805 | + 7 => $cid |
| 1806 | + ); |
| 1807 | + |
| 1808 | + return true; |
| 1809 | + } |
| 1810 | + |
| 1811 | + /** |
| 1812 | + * Returns true if an inline attachment is present. |
| 1813 | + * @access public |
| 1814 | + * @return bool |
| 1815 | + */ |
| 1816 | + public function InlineImageExists() { |
| 1817 | + foreach($this->attachment as $attachment) { |
| 1818 | + if ($attachment[6] == 'inline') { |
| 1819 | + return true; |
| 1820 | + } |
| 1821 | + } |
| 1822 | + return false; |
| 1823 | + } |
| 1824 | + |
| 1825 | + ///////////////////////////////////////////////// |
| 1826 | + // CLASS METHODS, MESSAGE RESET |
| 1827 | + ///////////////////////////////////////////////// |
| 1828 | + |
| 1829 | + /** |
| 1830 | + * Clears all recipients assigned in the TO array. Returns void. |
| 1831 | + * @return void |
| 1832 | + */ |
| 1833 | + public function ClearAddresses() { |
| 1834 | + foreach($this->to as $to) { |
| 1835 | + unset($this->all_recipients[strtolower($to[0])]); |
| 1836 | + } |
| 1837 | + $this->to = array(); |
| 1838 | + } |
| 1839 | + |
| 1840 | + /** |
| 1841 | + * Clears all recipients assigned in the CC array. Returns void. |
| 1842 | + * @return void |
| 1843 | + */ |
| 1844 | + public function ClearCCs() { |
| 1845 | + foreach($this->cc as $cc) { |
| 1846 | + unset($this->all_recipients[strtolower($cc[0])]); |
| 1847 | + } |
| 1848 | + $this->cc = array(); |
| 1849 | + } |
| 1850 | + |
| 1851 | + /** |
| 1852 | + * Clears all recipients assigned in the BCC array. Returns void. |
| 1853 | + * @return void |
| 1854 | + */ |
| 1855 | + public function ClearBCCs() { |
| 1856 | + foreach($this->bcc as $bcc) { |
| 1857 | + unset($this->all_recipients[strtolower($bcc[0])]); |
| 1858 | + } |
| 1859 | + $this->bcc = array(); |
| 1860 | + } |
| 1861 | + |
| 1862 | + /** |
| 1863 | + * Clears all recipients assigned in the ReplyTo array. Returns void. |
| 1864 | + * @return void |
| 1865 | + */ |
| 1866 | + public function ClearReplyTos() { |
| 1867 | + $this->ReplyTo = array(); |
| 1868 | + } |
| 1869 | + |
| 1870 | + /** |
| 1871 | + * Clears all recipients assigned in the TO, CC and BCC |
| 1872 | + * array. Returns void. |
| 1873 | + * @return void |
| 1874 | + */ |
| 1875 | + public function ClearAllRecipients() { |
| 1876 | + $this->to = array(); |
| 1877 | + $this->cc = array(); |
| 1878 | + $this->bcc = array(); |
| 1879 | + $this->all_recipients = array(); |
| 1880 | + } |
| 1881 | + |
| 1882 | + /** |
| 1883 | + * Clears all previously set filesystem, string, and binary |
| 1884 | + * attachments. Returns void. |
| 1885 | + * @return void |
| 1886 | + */ |
| 1887 | + public function ClearAttachments() { |
| 1888 | + $this->attachment = array(); |
| 1889 | + } |
| 1890 | + |
| 1891 | + /** |
| 1892 | + * Clears all custom headers. Returns void. |
| 1893 | + * @return void |
| 1894 | + */ |
| 1895 | + public function ClearCustomHeaders() { |
| 1896 | + $this->CustomHeader = array(); |
| 1897 | + } |
| 1898 | + |
| 1899 | + ///////////////////////////////////////////////// |
| 1900 | + // CLASS METHODS, MISCELLANEOUS |
| 1901 | + ///////////////////////////////////////////////// |
| 1902 | + |
| 1903 | + /** |
| 1904 | + * Adds the error message to the error container. |
| 1905 | + * @access protected |
| 1906 | + * @return void |
| 1907 | + */ |
| 1908 | + protected function SetError($msg) { |
| 1909 | + $this->error_count++; |
| 1910 | + if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { |
| 1911 | + $lasterror = $this->smtp->getError(); |
| 1912 | + if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) { |
| 1913 | + $msg .= '<p>' . $this->Lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n"; |
| 1914 | + } |
| 1915 | + } |
| 1916 | + $this->ErrorInfo = $msg; |
| 1917 | + } |
| 1918 | + |
| 1919 | + /** |
| 1920 | + * Returns the proper RFC 822 formatted date. |
| 1921 | + * @access public |
| 1922 | + * @return string |
| 1923 | + * @static |
| 1924 | + */ |
| 1925 | + public static function RFCDate() { |
| 1926 | + $tz = date('Z'); |
| 1927 | + $tzs = ($tz < 0) ? '-' : '+'; |
| 1928 | + $tz = abs($tz); |
| 1929 | + $tz = (int)($tz/3600)*100 + ($tz%3600)/60; |
| 1930 | + $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz); |
| 1931 | + |
| 1932 | + return $result; |
| 1933 | + } |
| 1934 | + |
| 1935 | + /** |
| 1936 | + * Returns the server hostname or 'localhost.localdomain' if unknown. |
| 1937 | + * @access private |
| 1938 | + * @return string |
| 1939 | + */ |
| 1940 | + private function ServerHostname() { |
| 1941 | + if (!empty($this->Hostname)) { |
| 1942 | + $result = $this->Hostname; |
| 1943 | + } elseif (isset($_SERVER['SERVER_NAME'])) { |
| 1944 | + $result = $_SERVER['SERVER_NAME']; |
| 1945 | + } else { |
| 1946 | + $result = 'localhost.localdomain'; |
| 1947 | + } |
| 1948 | + |
| 1949 | + return $result; |
| 1950 | + } |
| 1951 | + |
| 1952 | + /** |
| 1953 | + * Returns a message in the appropriate language. |
| 1954 | + * @access private |
| 1955 | + * @return string |
| 1956 | + */ |
| 1957 | + private function Lang($key) { |
| 1958 | + if(count($this->language) < 1) { |
| 1959 | + $this->SetLanguage('en'); // set the default language |
| 1960 | + } |
| 1961 | + |
| 1962 | + if(isset($this->language[$key])) { |
| 1963 | + return $this->language[$key]; |
| 1964 | + } else { |
| 1965 | + return 'Language string failed to load: ' . $key; |
| 1966 | + } |
| 1967 | + } |
| 1968 | + |
| 1969 | + /** |
| 1970 | + * Returns true if an error occurred. |
| 1971 | + * @access public |
| 1972 | + * @return bool |
| 1973 | + */ |
| 1974 | + public function IsError() { |
| 1975 | + return ($this->error_count > 0); |
| 1976 | + } |
| 1977 | + |
| 1978 | + /** |
| 1979 | + * Changes every end of line from CR or LF to CRLF. |
| 1980 | + * @access private |
| 1981 | + * @return string |
| 1982 | + */ |
| 1983 | + private function FixEOL($str) { |
| 1984 | + $str = str_replace("\r\n", "\n", $str); |
| 1985 | + $str = str_replace("\r", "\n", $str); |
| 1986 | + $str = str_replace("\n", $this->LE, $str); |
| 1987 | + return $str; |
| 1988 | + } |
| 1989 | + |
| 1990 | + /** |
| 1991 | + * Adds a custom header. |
| 1992 | + * @access public |
| 1993 | + * @return void |
| 1994 | + */ |
| 1995 | + public function AddCustomHeader($custom_header) { |
| 1996 | + $this->CustomHeader[] = explode(':', $custom_header, 2); |
| 1997 | + } |
| 1998 | + |
| 1999 | + /** |
| 2000 | + * Evaluates the message and returns modifications for inline images and backgrounds |
| 2001 | + * @access public |
| 2002 | + * @return $message |
| 2003 | + */ |
| 2004 | + public function MsgHTML($message, $basedir = '') { |
| 2005 | + preg_match_all("/(src|background)=\"(.*)\"/Ui", $message, $images); |
| 2006 | + if(isset($images[2])) { |
| 2007 | + foreach($images[2] as $i => $url) { |
| 2008 | + // do not change urls for absolute images (thanks to corvuscorax) |
| 2009 | + if (!preg_match('#^[A-z]+://#',$url)) { |
| 2010 | + $filename = basename($url); |
| 2011 | + $directory = dirname($url); |
| 2012 | + ($directory == '.')?$directory='':''; |
| 2013 | + $cid = 'cid:' . md5($filename); |
| 2014 | + $ext = pathinfo($filename, PATHINFO_EXTENSION); |
| 2015 | + $mimeType = self::_mime_types($ext); |
| 2016 | + if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; } |
| 2017 | + if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; } |
| 2018 | + if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) { |
| 2019 | + $message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message); |
| 2020 | + } |
| 2021 | + } |
| 2022 | + } |
| 2023 | + } |
| 2024 | + $this->IsHTML(true); |
| 2025 | + $this->Body = $message; |
| 2026 | + $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message))); |
| 2027 | + if (!empty($textMsg) && empty($this->AltBody)) { |
| 2028 | + $this->AltBody = html_entity_decode($textMsg); |
| 2029 | + } |
| 2030 | + if (empty($this->AltBody)) { |
| 2031 | + $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n"; |
| 2032 | + } |
| 2033 | + } |
| 2034 | + |
| 2035 | + /** |
| 2036 | + * Gets the MIME type of the embedded or inline image |
| 2037 | + * @param string File extension |
| 2038 | + * @access public |
| 2039 | + * @return string MIME type of ext |
| 2040 | + * @static |
| 2041 | + */ |
| 2042 | + public static function _mime_types($ext = '') { |
| 2043 | + $mimes = array( |
| 2044 | + 'hqx' => 'application/mac-binhex40', |
| 2045 | + 'cpt' => 'application/mac-compactpro', |
| 2046 | + 'doc' => 'application/msword', |
| 2047 | + 'bin' => 'application/macbinary', |
| 2048 | + 'dms' => 'application/octet-stream', |
| 2049 | + 'lha' => 'application/octet-stream', |
| 2050 | + 'lzh' => 'application/octet-stream', |
| 2051 | + 'exe' => 'application/octet-stream', |
| 2052 | + 'class' => 'application/octet-stream', |
| 2053 | + 'psd' => 'application/octet-stream', |
| 2054 | + 'so' => 'application/octet-stream', |
| 2055 | + 'sea' => 'application/octet-stream', |
| 2056 | + 'dll' => 'application/octet-stream', |
| 2057 | + 'oda' => 'application/oda', |
| 2058 | + 'pdf' => 'application/pdf', |
| 2059 | + 'ai' => 'application/postscript', |
| 2060 | + 'eps' => 'application/postscript', |
| 2061 | + 'ps' => 'application/postscript', |
| 2062 | + 'smi' => 'application/smil', |
| 2063 | + 'smil' => 'application/smil', |
| 2064 | + 'mif' => 'application/vnd.mif', |
| 2065 | + 'xls' => 'application/vnd.ms-excel', |
| 2066 | + 'ppt' => 'application/vnd.ms-powerpoint', |
| 2067 | + 'wbxml' => 'application/vnd.wap.wbxml', |
| 2068 | + 'wmlc' => 'application/vnd.wap.wmlc', |
| 2069 | + 'dcr' => 'application/x-director', |
| 2070 | + 'dir' => 'application/x-director', |
| 2071 | + 'dxr' => 'application/x-director', |
| 2072 | + 'dvi' => 'application/x-dvi', |
| 2073 | + 'gtar' => 'application/x-gtar', |
| 2074 | + 'php' => 'application/x-httpd-php', |
| 2075 | + 'php4' => 'application/x-httpd-php', |
| 2076 | + 'php3' => 'application/x-httpd-php', |
| 2077 | + 'phtml' => 'application/x-httpd-php', |
| 2078 | + 'phps' => 'application/x-httpd-php-source', |
| 2079 | + 'js' => 'application/x-javascript', |
| 2080 | + 'swf' => 'application/x-shockwave-flash', |
| 2081 | + 'sit' => 'application/x-stuffit', |
| 2082 | + 'tar' => 'application/x-tar', |
| 2083 | + 'tgz' => 'application/x-tar', |
| 2084 | + 'xhtml' => 'application/xhtml+xml', |
| 2085 | + 'xht' => 'application/xhtml+xml', |
| 2086 | + 'zip' => 'application/zip', |
| 2087 | + 'mid' => 'audio/midi', |
| 2088 | + 'midi' => 'audio/midi', |
| 2089 | + 'mpga' => 'audio/mpeg', |
| 2090 | + 'mp2' => 'audio/mpeg', |
| 2091 | + 'mp3' => 'audio/mpeg', |
| 2092 | + 'aif' => 'audio/x-aiff', |
| 2093 | + 'aiff' => 'audio/x-aiff', |
| 2094 | + 'aifc' => 'audio/x-aiff', |
| 2095 | + 'ram' => 'audio/x-pn-realaudio', |
| 2096 | + 'rm' => 'audio/x-pn-realaudio', |
| 2097 | + 'rpm' => 'audio/x-pn-realaudio-plugin', |
| 2098 | + 'ra' => 'audio/x-realaudio', |
| 2099 | + 'rv' => 'video/vnd.rn-realvideo', |
| 2100 | + 'wav' => 'audio/x-wav', |
| 2101 | + 'bmp' => 'image/bmp', |
| 2102 | + 'gif' => 'image/gif', |
| 2103 | + 'jpeg' => 'image/jpeg', |
| 2104 | + 'jpg' => 'image/jpeg', |
| 2105 | + 'jpe' => 'image/jpeg', |
| 2106 | + 'png' => 'image/png', |
| 2107 | + 'tiff' => 'image/tiff', |
| 2108 | + 'tif' => 'image/tiff', |
| 2109 | + 'css' => 'text/css', |
| 2110 | + 'html' => 'text/html', |
| 2111 | + 'htm' => 'text/html', |
| 2112 | + 'shtml' => 'text/html', |
| 2113 | + 'txt' => 'text/plain', |
| 2114 | + 'text' => 'text/plain', |
| 2115 | + 'log' => 'text/plain', |
| 2116 | + 'rtx' => 'text/richtext', |
| 2117 | + 'rtf' => 'text/rtf', |
| 2118 | + 'xml' => 'text/xml', |
| 2119 | + 'xsl' => 'text/xml', |
| 2120 | + 'mpeg' => 'video/mpeg', |
| 2121 | + 'mpg' => 'video/mpeg', |
| 2122 | + 'mpe' => 'video/mpeg', |
| 2123 | + 'qt' => 'video/quicktime', |
| 2124 | + 'mov' => 'video/quicktime', |
| 2125 | + 'avi' => 'video/x-msvideo', |
| 2126 | + 'movie' => 'video/x-sgi-movie', |
| 2127 | + 'doc' => 'application/msword', |
| 2128 | + 'word' => 'application/msword', |
| 2129 | + 'xl' => 'application/excel', |
| 2130 | + 'eml' => 'message/rfc822' |
| 2131 | + ); |
| 2132 | + return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)]; |
| 2133 | + } |
| 2134 | + |
| 2135 | + /** |
| 2136 | + * Set (or reset) Class Objects (variables) |
| 2137 | + * |
| 2138 | + * Usage Example: |
| 2139 | + * $page->set('X-Priority', '3'); |
| 2140 | + * |
| 2141 | + * @access public |
| 2142 | + * @param string $name Parameter Name |
| 2143 | + * @param mixed $value Parameter Value |
| 2144 | + * NOTE: will not work with arrays, there are no arrays to set/reset |
| 2145 | + * @todo Should this not be using __set() magic function? |
| 2146 | + */ |
| 2147 | + public function set($name, $value = '') { |
| 2148 | + try { |
| 2149 | + if (isset($this->$name) ) { |
| 2150 | + $this->$name = $value; |
| 2151 | + } else { |
| 2152 | + throw new phpmailerException($this->Lang('variable_set') . $name, self::STOP_CRITICAL); |
| 2153 | + } |
| 2154 | + } catch (Exception $e) { |
| 2155 | + $this->SetError($e->getMessage()); |
| 2156 | + if ($e->getCode() == self::STOP_CRITICAL) { |
| 2157 | + return false; |
| 2158 | + } |
| 2159 | + } |
| 2160 | + return true; |
| 2161 | + } |
| 2162 | + |
| 2163 | + /** |
| 2164 | + * Strips newlines to prevent header injection. |
| 2165 | + * @access public |
| 2166 | + * @param string $str String |
| 2167 | + * @return string |
| 2168 | + */ |
| 2169 | + public function SecureHeader($str) { |
| 2170 | + $str = str_replace("\r", '', $str); |
| 2171 | + $str = str_replace("\n", '', $str); |
| 2172 | + return trim($str); |
| 2173 | + } |
| 2174 | + |
| 2175 | + /** |
| 2176 | + * Set the private key file and password to sign the message. |
| 2177 | + * |
| 2178 | + * @access public |
| 2179 | + * @param string $key_filename Parameter File Name |
| 2180 | + * @param string $key_pass Password for private key |
| 2181 | + */ |
| 2182 | + public function Sign($cert_filename, $key_filename, $key_pass) { |
| 2183 | + $this->sign_cert_file = $cert_filename; |
| 2184 | + $this->sign_key_file = $key_filename; |
| 2185 | + $this->sign_key_pass = $key_pass; |
| 2186 | + } |
| 2187 | + |
| 2188 | + /** |
| 2189 | + * Set the private key file and password to sign the message. |
| 2190 | + * |
| 2191 | + * @access public |
| 2192 | + * @param string $key_filename Parameter File Name |
| 2193 | + * @param string $key_pass Password for private key |
| 2194 | + */ |
| 2195 | + public function DKIM_QP($txt) { |
| 2196 | + $tmp=""; |
| 2197 | + $line=""; |
| 2198 | + for ($i=0;$i<strlen($txt);$i++) { |
| 2199 | + $ord=ord($txt[$i]); |
| 2200 | + if ( ((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E)) ) { |
| 2201 | + $line.=$txt[$i]; |
| 2202 | + } else { |
| 2203 | + $line.="=".sprintf("%02X",$ord); |
| 2204 | + } |
| 2205 | + } |
| 2206 | + return $line; |
| 2207 | + } |
| 2208 | + |
| 2209 | + /** |
| 2210 | + * Generate DKIM signature |
| 2211 | + * |
| 2212 | + * @access public |
| 2213 | + * @param string $s Header |
| 2214 | + */ |
| 2215 | + public function DKIM_Sign($s) { |
| 2216 | + $privKeyStr = file_get_contents($this->DKIM_private); |
| 2217 | + if ($this->DKIM_passphrase!='') { |
| 2218 | + $privKey = openssl_pkey_get_private($privKeyStr,$this->DKIM_passphrase); |
| 2219 | + } else { |
| 2220 | + $privKey = $privKeyStr; |
| 2221 | + } |
| 2222 | + if (openssl_sign($s, $signature, $privKey)) { |
| 2223 | + return base64_encode($signature); |
| 2224 | + } |
| 2225 | + } |
| 2226 | + |
| 2227 | + /** |
| 2228 | + * Generate DKIM Canonicalization Header |
| 2229 | + * |
| 2230 | + * @access public |
| 2231 | + * @param string $s Header |
| 2232 | + */ |
| 2233 | + public function DKIM_HeaderC($s) { |
| 2234 | + $s=preg_replace("/\r\n\s+/"," ",$s); |
| 2235 | + $lines=explode("\r\n",$s); |
| 2236 | + foreach ($lines as $key=>$line) { |
| 2237 | + list($heading,$value)=explode(":",$line,2); |
| 2238 | + $heading=strtolower($heading); |
| 2239 | + $value=preg_replace("/\s+/"," ",$value) ; // Compress useless spaces |
| 2240 | + $lines[$key]=$heading.":".trim($value) ; // Don't forget to remove WSP around the value |
| 2241 | + } |
| 2242 | + $s=implode("\r\n",$lines); |
| 2243 | + return $s; |
| 2244 | + } |
| 2245 | + |
| 2246 | + /** |
| 2247 | + * Generate DKIM Canonicalization Body |
| 2248 | + * |
| 2249 | + * @access public |
| 2250 | + * @param string $body Message Body |
| 2251 | + */ |
| 2252 | + public function DKIM_BodyC($body) { |
| 2253 | + if ($body == '') return "\r\n"; |
| 2254 | + // stabilize line endings |
| 2255 | + $body=str_replace("\r\n","\n",$body); |
| 2256 | + $body=str_replace("\n","\r\n",$body); |
| 2257 | + // END stabilize line endings |
| 2258 | + while (substr($body,strlen($body)-4,4) == "\r\n\r\n") { |
| 2259 | + $body=substr($body,0,strlen($body)-2); |
| 2260 | + } |
| 2261 | + return $body; |
| 2262 | + } |
| 2263 | + |
| 2264 | + /** |
| 2265 | + * Create the DKIM header, body, as new header |
| 2266 | + * |
| 2267 | + * @access public |
| 2268 | + * @param string $headers_line Header lines |
| 2269 | + * @param string $subject Subject |
| 2270 | + * @param string $body Body |
| 2271 | + */ |
| 2272 | + public function DKIM_Add($headers_line,$subject,$body) { |
| 2273 | + $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms |
| 2274 | + $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body |
| 2275 | + $DKIMquery = 'dns/txt'; // Query method |
| 2276 | + $DKIMtime = time() ; // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) |
| 2277 | + $subject_header = "Subject: $subject"; |
| 2278 | + $headers = explode("\r\n",$headers_line); |
| 2279 | + foreach($headers as $header) { |
| 2280 | + if (strpos($header,'From:') === 0) { |
| 2281 | + $from_header=$header; |
| 2282 | + } elseif (strpos($header,'To:') === 0) { |
| 2283 | + $to_header=$header; |
| 2284 | + } |
| 2285 | + } |
| 2286 | + $from = str_replace('|','=7C',$this->DKIM_QP($from_header)); |
| 2287 | + $to = str_replace('|','=7C',$this->DKIM_QP($to_header)); |
| 2288 | + $subject = str_replace('|','=7C',$this->DKIM_QP($subject_header)) ; // Copied header fields (dkim-quoted-printable |
| 2289 | + $body = $this->DKIM_BodyC($body); |
| 2290 | + $DKIMlen = strlen($body) ; // Length of body |
| 2291 | + $DKIMb64 = base64_encode(pack("H*", sha1($body))) ; // Base64 of packed binary SHA-1 hash of body |
| 2292 | + $ident = ($this->DKIM_identity == '')? '' : " i=" . $this->DKIM_identity . ";"; |
| 2293 | + $dkimhdrs = "DKIM-Signature: v=1; a=" . $DKIMsignatureType . "; q=" . $DKIMquery . "; l=" . $DKIMlen . "; s=" . $this->DKIM_selector . ";\r\n". |
| 2294 | + "\tt=" . $DKIMtime . "; c=" . $DKIMcanonicalization . ";\r\n". |
| 2295 | + "\th=From:To:Subject;\r\n". |
| 2296 | + "\td=" . $this->DKIM_domain . ";" . $ident . "\r\n". |
| 2297 | + "\tz=$from\r\n". |
| 2298 | + "\t|$to\r\n". |
| 2299 | + "\t|$subject;\r\n". |
| 2300 | + "\tbh=" . $DKIMb64 . ";\r\n". |
| 2301 | + "\tb="; |
| 2302 | + $toSign = $this->DKIM_HeaderC($from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs); |
| 2303 | + $signed = $this->DKIM_Sign($toSign); |
| 2304 | + return "X-PHPMAILER-DKIM: phpmailer.worxware.com\r\n".$dkimhdrs.$signed."\r\n"; |
| 2305 | + } |
| 2306 | + |
| 2307 | + protected function doCallback($isSent,$to,$cc,$bcc,$subject,$body) { |
| 2308 | + if (!empty($this->action_function) && function_exists($this->action_function)) { |
| 2309 | + $params = array($isSent,$to,$cc,$bcc,$subject,$body); |
| 2310 | + call_user_func_array($this->action_function,$params); |
| 2311 | + } |
| 2312 | + } |
| 2313 | +} |
| 2314 | + |
| 2315 | +class phpmailerException extends Exception { |
| 2316 | + public function errorMessage() { |
| 2317 | + $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n"; |
| 2318 | + return $errorMsg; |
| 2319 | + } |
| 2320 | +} |
| 2321 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/class.phpmailer.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 2322 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/class.pop3.php |
— | — | @@ -0,0 +1,407 @@ |
| 2 | +<?php |
| 3 | +/*~ class.pop3.php |
| 4 | +.---------------------------------------------------------------------------. |
| 5 | +| Software: PHPMailer - PHP email class | |
| 6 | +| Version: 5.1 | |
| 7 | +| Contact: via sourceforge.net support pages (also www.codeworxtech.com) | |
| 8 | +| Info: http://phpmailer.sourceforge.net | |
| 9 | +| Support: http://sourceforge.net/projects/phpmailer/ | |
| 10 | +| ------------------------------------------------------------------------- | |
| 11 | +| Admin: Andy Prevost (project admininistrator) | |
| 12 | +| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net | |
| 13 | +| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net | |
| 14 | +| Founder: Brent R. Matzelle (original founder) | |
| 15 | +| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. | |
| 16 | +| Copyright (c) 2001-2003, Brent R. Matzelle | |
| 17 | +| ------------------------------------------------------------------------- | |
| 18 | +| License: Distributed under the Lesser General Public License (LGPL) | |
| 19 | +| http://www.gnu.org/copyleft/lesser.html | |
| 20 | +| This program is distributed in the hope that it will be useful - WITHOUT | |
| 21 | +| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 22 | +| FITNESS FOR A PARTICULAR PURPOSE. | |
| 23 | +| ------------------------------------------------------------------------- | |
| 24 | +| We offer a number of paid services (www.codeworxtech.com): | |
| 25 | +| - Web Hosting on highly optimized fast and secure servers | |
| 26 | +| - Technology Consulting | |
| 27 | +| - Oursourcing (highly qualified programmers and graphic designers) | |
| 28 | +'---------------------------------------------------------------------------' |
| 29 | +*/ |
| 30 | + |
| 31 | +/** |
| 32 | + * PHPMailer - PHP POP Before SMTP Authentication Class |
| 33 | + * NOTE: Designed for use with PHP version 5 and up |
| 34 | + * @package PHPMailer |
| 35 | + * @author Andy Prevost |
| 36 | + * @author Marcus Bointon |
| 37 | + * @copyright 2004 - 2009 Andy Prevost |
| 38 | + * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL) |
| 39 | + * @version $Id: class.pop3.php 444 2009-05-05 11:22:26Z coolbru $ |
| 40 | + */ |
| 41 | + |
| 42 | +/** |
| 43 | + * POP Before SMTP Authentication Class |
| 44 | + * Version 5.0.0 |
| 45 | + * |
| 46 | + * Author: Richard Davey (rich@corephp.co.uk) |
| 47 | + * Modifications: Andy Prevost |
| 48 | + * License: LGPL, see PHPMailer License |
| 49 | + * |
| 50 | + * Specifically for PHPMailer to allow POP before SMTP authentication. |
| 51 | + * Does not yet work with APOP - if you have an APOP account, contact Richard Davey |
| 52 | + * and we can test changes to this script. |
| 53 | + * |
| 54 | + * This class is based on the structure of the SMTP class originally authored by Chris Ryan |
| 55 | + * |
| 56 | + * This class is rfc 1939 compliant and implements all the commands |
| 57 | + * required for POP3 connection, authentication and disconnection. |
| 58 | + * |
| 59 | + * @package PHPMailer |
| 60 | + * @author Richard Davey |
| 61 | + */ |
| 62 | + |
| 63 | +class POP3 { |
| 64 | + /** |
| 65 | + * Default POP3 port |
| 66 | + * @var int |
| 67 | + */ |
| 68 | + public $POP3_PORT = 110; |
| 69 | + |
| 70 | + /** |
| 71 | + * Default Timeout |
| 72 | + * @var int |
| 73 | + */ |
| 74 | + public $POP3_TIMEOUT = 30; |
| 75 | + |
| 76 | + /** |
| 77 | + * POP3 Carriage Return + Line Feed |
| 78 | + * @var string |
| 79 | + */ |
| 80 | + public $CRLF = "\r\n"; |
| 81 | + |
| 82 | + /** |
| 83 | + * Displaying Debug warnings? (0 = now, 1+ = yes) |
| 84 | + * @var int |
| 85 | + */ |
| 86 | + public $do_debug = 2; |
| 87 | + |
| 88 | + /** |
| 89 | + * POP3 Mail Server |
| 90 | + * @var string |
| 91 | + */ |
| 92 | + public $host; |
| 93 | + |
| 94 | + /** |
| 95 | + * POP3 Port |
| 96 | + * @var int |
| 97 | + */ |
| 98 | + public $port; |
| 99 | + |
| 100 | + /** |
| 101 | + * POP3 Timeout Value |
| 102 | + * @var int |
| 103 | + */ |
| 104 | + public $tval; |
| 105 | + |
| 106 | + /** |
| 107 | + * POP3 Username |
| 108 | + * @var string |
| 109 | + */ |
| 110 | + public $username; |
| 111 | + |
| 112 | + /** |
| 113 | + * POP3 Password |
| 114 | + * @var string |
| 115 | + */ |
| 116 | + public $password; |
| 117 | + |
| 118 | + ///////////////////////////////////////////////// |
| 119 | + // PROPERTIES, PRIVATE AND PROTECTED |
| 120 | + ///////////////////////////////////////////////// |
| 121 | + |
| 122 | + private $pop_conn; |
| 123 | + private $connected; |
| 124 | + private $error; // Error log array |
| 125 | + |
| 126 | + /** |
| 127 | + * Constructor, sets the initial values |
| 128 | + * @access public |
| 129 | + * @return POP3 |
| 130 | + */ |
| 131 | + public function __construct() { |
| 132 | + $this->pop_conn = 0; |
| 133 | + $this->connected = false; |
| 134 | + $this->error = null; |
| 135 | + } |
| 136 | + |
| 137 | + /** |
| 138 | + * Combination of public events - connect, login, disconnect |
| 139 | + * @access public |
| 140 | + * @param string $host |
| 141 | + * @param integer $port |
| 142 | + * @param integer $tval |
| 143 | + * @param string $username |
| 144 | + * @param string $password |
| 145 | + */ |
| 146 | + public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) { |
| 147 | + $this->host = $host; |
| 148 | + |
| 149 | + // If no port value is passed, retrieve it |
| 150 | + if ($port == false) { |
| 151 | + $this->port = $this->POP3_PORT; |
| 152 | + } else { |
| 153 | + $this->port = $port; |
| 154 | + } |
| 155 | + |
| 156 | + // If no port value is passed, retrieve it |
| 157 | + if ($tval == false) { |
| 158 | + $this->tval = $this->POP3_TIMEOUT; |
| 159 | + } else { |
| 160 | + $this->tval = $tval; |
| 161 | + } |
| 162 | + |
| 163 | + $this->do_debug = $debug_level; |
| 164 | + $this->username = $username; |
| 165 | + $this->password = $password; |
| 166 | + |
| 167 | + // Refresh the error log |
| 168 | + $this->error = null; |
| 169 | + |
| 170 | + // Connect |
| 171 | + $result = $this->Connect($this->host, $this->port, $this->tval); |
| 172 | + |
| 173 | + if ($result) { |
| 174 | + $login_result = $this->Login($this->username, $this->password); |
| 175 | + |
| 176 | + if ($login_result) { |
| 177 | + $this->Disconnect(); |
| 178 | + |
| 179 | + return true; |
| 180 | + } |
| 181 | + |
| 182 | + } |
| 183 | + |
| 184 | + // We need to disconnect regardless if the login succeeded |
| 185 | + $this->Disconnect(); |
| 186 | + |
| 187 | + return false; |
| 188 | + } |
| 189 | + |
| 190 | + /** |
| 191 | + * Connect to the POP3 server |
| 192 | + * @access public |
| 193 | + * @param string $host |
| 194 | + * @param integer $port |
| 195 | + * @param integer $tval |
| 196 | + * @return boolean |
| 197 | + */ |
| 198 | + public function Connect ($host, $port = false, $tval = 30) { |
| 199 | + // Are we already connected? |
| 200 | + if ($this->connected) { |
| 201 | + return true; |
| 202 | + } |
| 203 | + |
| 204 | + /* |
| 205 | + On Windows this will raise a PHP Warning error if the hostname doesn't exist. |
| 206 | + Rather than supress it with @fsockopen, let's capture it cleanly instead |
| 207 | + */ |
| 208 | + |
| 209 | + set_error_handler(array(&$this, 'catchWarning')); |
| 210 | + |
| 211 | + // Connect to the POP3 server |
| 212 | + $this->pop_conn = fsockopen($host, // POP3 Host |
| 213 | + $port, // Port # |
| 214 | + $errno, // Error Number |
| 215 | + $errstr, // Error Message |
| 216 | + $tval); // Timeout (seconds) |
| 217 | + |
| 218 | + // Restore the error handler |
| 219 | + restore_error_handler(); |
| 220 | + |
| 221 | + // Does the Error Log now contain anything? |
| 222 | + if ($this->error && $this->do_debug >= 1) { |
| 223 | + $this->displayErrors(); |
| 224 | + } |
| 225 | + |
| 226 | + // Did we connect? |
| 227 | + if ($this->pop_conn == false) { |
| 228 | + // It would appear not... |
| 229 | + $this->error = array( |
| 230 | + 'error' => "Failed to connect to server $host on port $port", |
| 231 | + 'errno' => $errno, |
| 232 | + 'errstr' => $errstr |
| 233 | + ); |
| 234 | + |
| 235 | + if ($this->do_debug >= 1) { |
| 236 | + $this->displayErrors(); |
| 237 | + } |
| 238 | + |
| 239 | + return false; |
| 240 | + } |
| 241 | + |
| 242 | + // Increase the stream time-out |
| 243 | + |
| 244 | + // Check for PHP 4.3.0 or later |
| 245 | + if (version_compare(phpversion(), '5.0.0', 'ge')) { |
| 246 | + stream_set_timeout($this->pop_conn, $tval, 0); |
| 247 | + } else { |
| 248 | + // Does not work on Windows |
| 249 | + if (substr(PHP_OS, 0, 3) !== 'WIN') { |
| 250 | + socket_set_timeout($this->pop_conn, $tval, 0); |
| 251 | + } |
| 252 | + } |
| 253 | + |
| 254 | + // Get the POP3 server response |
| 255 | + $pop3_response = $this->getResponse(); |
| 256 | + |
| 257 | + // Check for the +OK |
| 258 | + if ($this->checkResponse($pop3_response)) { |
| 259 | + // The connection is established and the POP3 server is talking |
| 260 | + $this->connected = true; |
| 261 | + return true; |
| 262 | + } |
| 263 | + |
| 264 | + } |
| 265 | + |
| 266 | + /** |
| 267 | + * Login to the POP3 server (does not support APOP yet) |
| 268 | + * @access public |
| 269 | + * @param string $username |
| 270 | + * @param string $password |
| 271 | + * @return boolean |
| 272 | + */ |
| 273 | + public function Login ($username = '', $password = '') { |
| 274 | + if ($this->connected == false) { |
| 275 | + $this->error = 'Not connected to POP3 server'; |
| 276 | + |
| 277 | + if ($this->do_debug >= 1) { |
| 278 | + $this->displayErrors(); |
| 279 | + } |
| 280 | + } |
| 281 | + |
| 282 | + if (empty($username)) { |
| 283 | + $username = $this->username; |
| 284 | + } |
| 285 | + |
| 286 | + if (empty($password)) { |
| 287 | + $password = $this->password; |
| 288 | + } |
| 289 | + |
| 290 | + $pop_username = "USER $username" . $this->CRLF; |
| 291 | + $pop_password = "PASS $password" . $this->CRLF; |
| 292 | + |
| 293 | + // Send the Username |
| 294 | + $this->sendString($pop_username); |
| 295 | + $pop3_response = $this->getResponse(); |
| 296 | + |
| 297 | + if ($this->checkResponse($pop3_response)) { |
| 298 | + // Send the Password |
| 299 | + $this->sendString($pop_password); |
| 300 | + $pop3_response = $this->getResponse(); |
| 301 | + |
| 302 | + if ($this->checkResponse($pop3_response)) { |
| 303 | + return true; |
| 304 | + } else { |
| 305 | + return false; |
| 306 | + } |
| 307 | + } else { |
| 308 | + return false; |
| 309 | + } |
| 310 | + } |
| 311 | + |
| 312 | + /** |
| 313 | + * Disconnect from the POP3 server |
| 314 | + * @access public |
| 315 | + */ |
| 316 | + public function Disconnect () { |
| 317 | + $this->sendString('QUIT'); |
| 318 | + |
| 319 | + fclose($this->pop_conn); |
| 320 | + } |
| 321 | + |
| 322 | + ///////////////////////////////////////////////// |
| 323 | + // Private Methods |
| 324 | + ///////////////////////////////////////////////// |
| 325 | + |
| 326 | + /** |
| 327 | + * Get the socket response back. |
| 328 | + * $size is the maximum number of bytes to retrieve |
| 329 | + * @access private |
| 330 | + * @param integer $size |
| 331 | + * @return string |
| 332 | + */ |
| 333 | + private function getResponse ($size = 128) { |
| 334 | + $pop3_response = fgets($this->pop_conn, $size); |
| 335 | + |
| 336 | + return $pop3_response; |
| 337 | + } |
| 338 | + |
| 339 | + /** |
| 340 | + * Send a string down the open socket connection to the POP3 server |
| 341 | + * @access private |
| 342 | + * @param string $string |
| 343 | + * @return integer |
| 344 | + */ |
| 345 | + private function sendString ($string) { |
| 346 | + $bytes_sent = fwrite($this->pop_conn, $string, strlen($string)); |
| 347 | + |
| 348 | + return $bytes_sent; |
| 349 | + } |
| 350 | + |
| 351 | + /** |
| 352 | + * Checks the POP3 server response for +OK or -ERR |
| 353 | + * @access private |
| 354 | + * @param string $string |
| 355 | + * @return boolean |
| 356 | + */ |
| 357 | + private function checkResponse ($string) { |
| 358 | + if (substr($string, 0, 3) !== '+OK') { |
| 359 | + $this->error = array( |
| 360 | + 'error' => "Server reported an error: $string", |
| 361 | + 'errno' => 0, |
| 362 | + 'errstr' => '' |
| 363 | + ); |
| 364 | + |
| 365 | + if ($this->do_debug >= 1) { |
| 366 | + $this->displayErrors(); |
| 367 | + } |
| 368 | + |
| 369 | + return false; |
| 370 | + } else { |
| 371 | + return true; |
| 372 | + } |
| 373 | + |
| 374 | + } |
| 375 | + |
| 376 | + /** |
| 377 | + * If debug is enabled, display the error message array |
| 378 | + * @access private |
| 379 | + */ |
| 380 | + private function displayErrors () { |
| 381 | + echo '<pre>'; |
| 382 | + |
| 383 | + foreach ($this->error as $single_error) { |
| 384 | + print_r($single_error); |
| 385 | + } |
| 386 | + |
| 387 | + echo '</pre>'; |
| 388 | + } |
| 389 | + |
| 390 | + /** |
| 391 | + * Takes over from PHP for the socket warning handler |
| 392 | + * @access private |
| 393 | + * @param integer $errno |
| 394 | + * @param string $errstr |
| 395 | + * @param string $errfile |
| 396 | + * @param integer $errline |
| 397 | + */ |
| 398 | + private function catchWarning ($errno, $errstr, $errfile, $errline) { |
| 399 | + $this->error[] = array( |
| 400 | + 'error' => "Connecting to the POP3 server raised a PHP warning: ", |
| 401 | + 'errno' => $errno, |
| 402 | + 'errstr' => $errstr |
| 403 | + ); |
| 404 | + } |
| 405 | + |
| 406 | + // End of class |
| 407 | +} |
| 408 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/class.pop3.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 409 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/README |
— | — | @@ -0,0 +1,218 @@ |
| 2 | +/*******************************************************************
|
| 3 | +* The http://phpmailer.codeworxtech.com/ website now carries a few *
|
| 4 | +* advertisements through the Google Adsense network. Please visit *
|
| 5 | +* the advertiser sites and help us offset some of our costs. *
|
| 6 | +* Thanks .... *
|
| 7 | +********************************************************************/
|
| 8 | +
|
| 9 | +PHPMailer
|
| 10 | +Full Featured Email Transfer Class for PHP
|
| 11 | +==========================================
|
| 12 | +
|
| 13 | +Version 5.0.0 (April 02, 2009)
|
| 14 | +
|
| 15 | +With the release of this version, we are initiating a new version numbering
|
| 16 | +system to differentiate from the PHP4 version of PHPMailer.
|
| 17 | +
|
| 18 | +Most notable in this release is fully object oriented code.
|
| 19 | +
|
| 20 | +We now have available the PHPDocumentor (phpdocs) documentation. This is
|
| 21 | +separate from the regular download to keep file sizes down. Please see the
|
| 22 | +download area of http://phpmailer.codeworxtech.com.
|
| 23 | +
|
| 24 | +We also have created a new test script (see /test_script) that you can use
|
| 25 | +right out of the box. Copy the /test_script folder directly to your server (in
|
| 26 | +the same structure ... with class.phpmailer.php and class.smtp.php in the
|
| 27 | +folder above it. Then launch the test script with:
|
| 28 | +http://www.yourdomain.com/phpmailer/test_script/index.php
|
| 29 | +from this one script, you can test your server settings for mail(), sendmail (or
|
| 30 | +qmail), and SMTP. This will email you a sample email (using contents.html for
|
| 31 | +the email body) and two attachments. One of the attachments is used as an inline
|
| 32 | +image to demonstrate how PHPMailer will automatically detect if attachments are
|
| 33 | +the same source as inline graphics and only include one version. Once you click
|
| 34 | +the Submit button, the results will be displayed including any SMTP debug
|
| 35 | +information and send status. We will also display a version of the script that
|
| 36 | +you can cut and paste to include in your projects. Enjoy!
|
| 37 | +
|
| 38 | +Version 2.3 (November 08, 2008)
|
| 39 | +
|
| 40 | +We have removed the /phpdoc from the downloads. All documentation is now on
|
| 41 | +the http://phpmailer.codeworxtech.com website.
|
| 42 | +
|
| 43 | +The phpunit.php has been updated to support PHP5.
|
| 44 | +
|
| 45 | +For all other changes and notes, please see the changelog.
|
| 46 | +
|
| 47 | +Donations are accepted at PayPal with our id "paypal@worxteam.com".
|
| 48 | +
|
| 49 | +Version 2.2 (July 15 2008)
|
| 50 | +
|
| 51 | +- see the changelog.
|
| 52 | +
|
| 53 | +Version 2.1 (June 04 2008)
|
| 54 | +
|
| 55 | +With this release, we are announcing that the development of PHPMailer for PHP5
|
| 56 | +will be our focus from this date on. We have implemented all the enhancements
|
| 57 | +and fixes from the latest release of PHPMailer for PHP4.
|
| 58 | +
|
| 59 | +Far more important, though, is that this release of PHPMailer (v2.1) is
|
| 60 | +fully tested with E_STRICT error checking enabled.
|
| 61 | +
|
| 62 | +** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.
|
| 63 | + IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE
|
| 64 | + APPRECIATED.
|
| 65 | +
|
| 66 | +We have now added S/MIME functionality (ability to digitally sign emails).
|
| 67 | +BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
|
| 68 | +The "Signed Emails" functionality adds the Sign method to pass the private key
|
| 69 | +filename and the password to read it, and then email will be sent with
|
| 70 | +content-type multipart/signed and with the digital signature attached.
|
| 71 | +
|
| 72 | +A quick note on E_STRICT:
|
| 73 | +
|
| 74 | +- In about half the test environments the development version was subjected
|
| 75 | + to, an error was thrown for the date() functions (used at line 1565 and 1569).
|
| 76 | + This is NOT a PHPMailer error, it is the result of an incorrectly configured
|
| 77 | + PHP5 installation. The fix is to modify your 'php.ini' file and include the
|
| 78 | + date.timezone = America/New York
|
| 79 | + directive, (for your own server timezone)
|
| 80 | +- If you do get this error, and are unable to access your php.ini file, there is
|
| 81 | + a workaround. In your PHP script, add
|
| 82 | + date_default_timezone_set('America/Toronto');
|
| 83 | +
|
| 84 | + * do NOT try to use
|
| 85 | + $myVar = date_default_timezone_get();
|
| 86 | + as a test, it will throw an error.
|
| 87 | +
|
| 88 | +We have also included more example files to show the use of "sendmail", "mail()",
|
| 89 | +"smtp", and "gmail".
|
| 90 | +
|
| 91 | +We are also looking for more programmers to join the volunteer development team.
|
| 92 | +If you have an interest in this, please let us know.
|
| 93 | +
|
| 94 | +Enjoy!
|
| 95 | +
|
| 96 | +
|
| 97 | +Version 2.1.0beta1 & beta2
|
| 98 | +
|
| 99 | +please note, this is BETA software
|
| 100 | +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS
|
| 101 | +INTENDED STRICTLY FOR TESTING
|
| 102 | +
|
| 103 | +** NOTE:
|
| 104 | +
|
| 105 | +As of November 2007, PHPMailer has a new project team headed by industry
|
| 106 | +veteran Andy Prevost (codeworxtech). The first release in more than two
|
| 107 | +years will focus on fixes, adding ease-of-use enhancements, provide
|
| 108 | +basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility
|
| 109 | +features. A new release is planned before year-end 2007 that will provide
|
| 110 | +full compatiblity with PHP4 and PHP5, as well as more bug fixes.
|
| 111 | +
|
| 112 | +We are looking for project developers to assist in restoring PHPMailer to
|
| 113 | +its leadership position. Our goals are to simplify use of PHPMailer, provide
|
| 114 | +good documentation and examples, and retain backward compatibility to level
|
| 115 | +1.7.3 standards.
|
| 116 | +
|
| 117 | +If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer
|
| 118 | +and indicate your interest.
|
| 119 | +
|
| 120 | +**
|
| 121 | +
|
| 122 | +http://phpmailer.sourceforge.net/
|
| 123 | +
|
| 124 | +This software is licenced under the LGPL. Please read LICENSE for information on the
|
| 125 | +software availability and distribution.
|
| 126 | +
|
| 127 | +Class Features:
|
| 128 | +- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs
|
| 129 | +- Redundant SMTP servers
|
| 130 | +- Multipart/alternative emails for mail clients that do not read HTML email
|
| 131 | +- Support for 8bit, base64, binary, and quoted-printable encoding
|
| 132 | +- Uses the same methods as the very popular AspEmail active server (COM) component
|
| 133 | +- SMTP authentication
|
| 134 | +- Native language support
|
| 135 | +- Word wrap, and more!
|
| 136 | +
|
| 137 | +Why you might need it:
|
| 138 | +
|
| 139 | +Many PHP developers utilize email in their code. The only PHP function
|
| 140 | +that supports this is the mail() function. However, it does not expose
|
| 141 | +any of the popular features that many email clients use nowadays like
|
| 142 | +HTML-based emails and attachments. There are two proprietary
|
| 143 | +development tools out there that have all the functionality built into
|
| 144 | +easy to use classes: AspEmail(tm) and AspMail. Both of these
|
| 145 | +programs are COM components only available on Windows. They are also a
|
| 146 | +little pricey for smaller projects.
|
| 147 | +
|
| 148 | +Since I do Linux development I�ve missed these tools for my PHP coding.
|
| 149 | +So I built a version myself that implements the same methods (object
|
| 150 | +calls) that the Windows-based components do. It is open source and the
|
| 151 | +LGPL license allows you to place the class in your proprietary PHP
|
| 152 | +projects.
|
| 153 | +
|
| 154 | +
|
| 155 | +Installation:
|
| 156 | +
|
| 157 | +Copy class.phpmailer.php into your php.ini include_path. If you are
|
| 158 | +using the SMTP mailer then place class.smtp.php in your path as well.
|
| 159 | +In the language directory you will find several files like
|
| 160 | +phpmailer.lang-en.php. If you look right before the .php extension
|
| 161 | +that there are two letters. These represent the language type of the
|
| 162 | +translation file. For instance "en" is the English file and "br" is
|
| 163 | +the Portuguese file. Chose the file that best fits with your language
|
| 164 | +and place it in the PHP include path. If your language is English
|
| 165 | +then you have nothing more to do. If it is a different language then
|
| 166 | +you must point PHPMailer to the correct translation. To do this, call
|
| 167 | +the PHPMailer SetLanguage method like so:
|
| 168 | +
|
| 169 | +// To load the Portuguese version
|
| 170 | +$mail->SetLanguage("br", "/optional/path/to/language/directory/");
|
| 171 | +
|
| 172 | +That's it. You should now be ready to use PHPMailer!
|
| 173 | +
|
| 174 | +
|
| 175 | +A Simple Example:
|
| 176 | +
|
| 177 | +<?php
|
| 178 | +require("class.phpmailer.php");
|
| 179 | +
|
| 180 | +$mail = new PHPMailer();
|
| 181 | +
|
| 182 | +$mail->IsSMTP(); // set mailer to use SMTP
|
| 183 | +$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server
|
| 184 | +$mail->SMTPAuth = true; // turn on SMTP authentication
|
| 185 | +$mail->Username = "jswan"; // SMTP username
|
| 186 | +$mail->Password = "secret"; // SMTP password
|
| 187 | +
|
| 188 | +$mail->From = "from@example.com";
|
| 189 | +$mail->FromName = "Mailer";
|
| 190 | +$mail->AddAddress("josh@example.net", "Josh Adams");
|
| 191 | +$mail->AddAddress("ellen@example.com"); // name is optional
|
| 192 | +$mail->AddReplyTo("info@example.com", "Information");
|
| 193 | +
|
| 194 | +$mail->WordWrap = 50; // set word wrap to 50 characters
|
| 195 | +$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
|
| 196 | +$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
|
| 197 | +$mail->IsHTML(true); // set email format to HTML
|
| 198 | +
|
| 199 | +$mail->Subject = "Here is the subject";
|
| 200 | +$mail->Body = "This is the HTML message body <b>in bold!</b>";
|
| 201 | +$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
|
| 202 | +
|
| 203 | +if(!$mail->Send())
|
| 204 | +{
|
| 205 | + echo "Message could not be sent. <p>";
|
| 206 | + echo "Mailer Error: " . $mail->ErrorInfo;
|
| 207 | + exit;
|
| 208 | +}
|
| 209 | +
|
| 210 | +echo "Message has been sent";
|
| 211 | +?>
|
| 212 | +
|
| 213 | +CHANGELOG
|
| 214 | +
|
| 215 | +See ChangeLog.txt
|
| 216 | +
|
| 217 | +Download: http://sourceforge.net/project/showfiles.php?group_id=26031
|
| 218 | +
|
| 219 | +Andy Prevost
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/README |
___________________________________________________________________ |
Added: svn:executable |
1 | 220 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/class.smtp.php |
— | — | @@ -0,0 +1,814 @@ |
| 2 | +<?php
|
| 3 | +/*~ class.smtp.php
|
| 4 | +.---------------------------------------------------------------------------.
|
| 5 | +| Software: PHPMailer - PHP email class |
|
| 6 | +| Version: 5.1 |
|
| 7 | +| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
| 8 | +| Info: http://phpmailer.sourceforge.net |
|
| 9 | +| Support: http://sourceforge.net/projects/phpmailer/ |
|
| 10 | +| ------------------------------------------------------------------------- |
|
| 11 | +| Admin: Andy Prevost (project admininistrator) |
|
| 12 | +| Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
|
| 13 | +| : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
|
| 14 | +| Founder: Brent R. Matzelle (original founder) |
|
| 15 | +| Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
|
| 16 | +| Copyright (c) 2001-2003, Brent R. Matzelle |
|
| 17 | +| ------------------------------------------------------------------------- |
|
| 18 | +| License: Distributed under the Lesser General Public License (LGPL) |
|
| 19 | +| http://www.gnu.org/copyleft/lesser.html |
|
| 20 | +| This program is distributed in the hope that it will be useful - WITHOUT |
|
| 21 | +| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
| 22 | +| FITNESS FOR A PARTICULAR PURPOSE. |
|
| 23 | +| ------------------------------------------------------------------------- |
|
| 24 | +| We offer a number of paid services (www.codeworxtech.com): |
|
| 25 | +| - Web Hosting on highly optimized fast and secure servers |
|
| 26 | +| - Technology Consulting |
|
| 27 | +| - Oursourcing (highly qualified programmers and graphic designers) |
|
| 28 | +'---------------------------------------------------------------------------'
|
| 29 | +*/
|
| 30 | +
|
| 31 | +/**
|
| 32 | + * PHPMailer - PHP SMTP email transport class
|
| 33 | + * NOTE: Designed for use with PHP version 5 and up
|
| 34 | + * @package PHPMailer
|
| 35 | + * @author Andy Prevost
|
| 36 | + * @author Marcus Bointon
|
| 37 | + * @copyright 2004 - 2008 Andy Prevost
|
| 38 | + * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
|
| 39 | + * @version $Id: class.smtp.php 444 2009-05-05 11:22:26Z coolbru $
|
| 40 | + */
|
| 41 | +
|
| 42 | +/**
|
| 43 | + * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
|
| 44 | + * commands except TURN which will always return a not implemented
|
| 45 | + * error. SMTP also provides some utility methods for sending mail
|
| 46 | + * to an SMTP server.
|
| 47 | + * original author: Chris Ryan
|
| 48 | + */
|
| 49 | +
|
| 50 | +class SMTP {
|
| 51 | + /**
|
| 52 | + * SMTP server port
|
| 53 | + * @var int
|
| 54 | + */
|
| 55 | + public $SMTP_PORT = 25;
|
| 56 | +
|
| 57 | + /**
|
| 58 | + * SMTP reply line ending
|
| 59 | + * @var string
|
| 60 | + */
|
| 61 | + public $CRLF = "\r\n";
|
| 62 | +
|
| 63 | + /**
|
| 64 | + * Sets whether debugging is turned on
|
| 65 | + * @var bool
|
| 66 | + */
|
| 67 | + public $do_debug; // the level of debug to perform
|
| 68 | +
|
| 69 | + /**
|
| 70 | + * Sets VERP use on/off (default is off)
|
| 71 | + * @var bool
|
| 72 | + */
|
| 73 | + public $do_verp = false;
|
| 74 | +
|
| 75 | + /////////////////////////////////////////////////
|
| 76 | + // PROPERTIES, PRIVATE AND PROTECTED
|
| 77 | + /////////////////////////////////////////////////
|
| 78 | +
|
| 79 | + private $smtp_conn; // the socket to the server
|
| 80 | + private $error; // error if any on the last call
|
| 81 | + private $helo_rply; // the reply the server sent to us for HELO
|
| 82 | +
|
| 83 | + /**
|
| 84 | + * Initialize the class so that the data is in a known state.
|
| 85 | + * @access public
|
| 86 | + * @return void
|
| 87 | + */
|
| 88 | + public function __construct() {
|
| 89 | + $this->smtp_conn = 0;
|
| 90 | + $this->error = null;
|
| 91 | + $this->helo_rply = null;
|
| 92 | +
|
| 93 | + $this->do_debug = 0;
|
| 94 | + }
|
| 95 | +
|
| 96 | + /////////////////////////////////////////////////
|
| 97 | + // CONNECTION FUNCTIONS
|
| 98 | + /////////////////////////////////////////////////
|
| 99 | +
|
| 100 | + /**
|
| 101 | + * Connect to the server specified on the port specified.
|
| 102 | + * If the port is not specified use the default SMTP_PORT.
|
| 103 | + * If tval is specified then a connection will try and be
|
| 104 | + * established with the server for that number of seconds.
|
| 105 | + * If tval is not specified the default is 30 seconds to
|
| 106 | + * try on the connection.
|
| 107 | + *
|
| 108 | + * SMTP CODE SUCCESS: 220
|
| 109 | + * SMTP CODE FAILURE: 421
|
| 110 | + * @access public
|
| 111 | + * @return bool
|
| 112 | + */
|
| 113 | + public function Connect($host, $port = 0, $tval = 30) {
|
| 114 | + // set the error val to null so there is no confusion
|
| 115 | + $this->error = null;
|
| 116 | +
|
| 117 | + // make sure we are __not__ connected
|
| 118 | + if($this->connected()) {
|
| 119 | + // already connected, generate error
|
| 120 | + $this->error = array("error" => "Already connected to a server");
|
| 121 | + return false;
|
| 122 | + }
|
| 123 | +
|
| 124 | + if(empty($port)) {
|
| 125 | + $port = $this->SMTP_PORT;
|
| 126 | + }
|
| 127 | +
|
| 128 | + // connect to the smtp server
|
| 129 | + $this->smtp_conn = @fsockopen($host, // the host of the server
|
| 130 | + $port, // the port to use
|
| 131 | + $errno, // error number if any
|
| 132 | + $errstr, // error message if any
|
| 133 | + $tval); // give up after ? secs
|
| 134 | + // verify we connected properly
|
| 135 | + if(empty($this->smtp_conn)) {
|
| 136 | + $this->error = array("error" => "Failed to connect to server",
|
| 137 | + "errno" => $errno,
|
| 138 | + "errstr" => $errstr);
|
| 139 | + if($this->do_debug >= 1) {
|
| 140 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
|
| 141 | + }
|
| 142 | + return false;
|
| 143 | + }
|
| 144 | +
|
| 145 | + // SMTP server can take longer to respond, give longer timeout for first read
|
| 146 | + // Windows does not have support for this timeout function
|
| 147 | + if(substr(PHP_OS, 0, 3) != "WIN")
|
| 148 | + socket_set_timeout($this->smtp_conn, $tval, 0);
|
| 149 | +
|
| 150 | + // get any announcement
|
| 151 | + $announce = $this->get_lines();
|
| 152 | +
|
| 153 | + if($this->do_debug >= 2) {
|
| 154 | + echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
|
| 155 | + }
|
| 156 | +
|
| 157 | + return true;
|
| 158 | + }
|
| 159 | +
|
| 160 | + /**
|
| 161 | + * Initiate a TLS communication with the server.
|
| 162 | + *
|
| 163 | + * SMTP CODE 220 Ready to start TLS
|
| 164 | + * SMTP CODE 501 Syntax error (no parameters allowed)
|
| 165 | + * SMTP CODE 454 TLS not available due to temporary reason
|
| 166 | + * @access public
|
| 167 | + * @return bool success
|
| 168 | + */
|
| 169 | + public function StartTLS() {
|
| 170 | + $this->error = null; # to avoid confusion
|
| 171 | +
|
| 172 | + if(!$this->connected()) {
|
| 173 | + $this->error = array("error" => "Called StartTLS() without being connected");
|
| 174 | + return false;
|
| 175 | + }
|
| 176 | +
|
| 177 | + fputs($this->smtp_conn,"STARTTLS" . $this->CRLF);
|
| 178 | +
|
| 179 | + $rply = $this->get_lines();
|
| 180 | + $code = substr($rply,0,3);
|
| 181 | +
|
| 182 | + if($this->do_debug >= 2) {
|
| 183 | + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
| 184 | + }
|
| 185 | +
|
| 186 | + if($code != 220) {
|
| 187 | + $this->error =
|
| 188 | + array("error" => "STARTTLS not accepted from server",
|
| 189 | + "smtp_code" => $code,
|
| 190 | + "smtp_msg" => substr($rply,4));
|
| 191 | + if($this->do_debug >= 1) {
|
| 192 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 193 | + }
|
| 194 | + return false;
|
| 195 | + }
|
| 196 | +
|
| 197 | + // Begin encrypted connection
|
| 198 | + if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
|
| 199 | + return false;
|
| 200 | + }
|
| 201 | +
|
| 202 | + return true;
|
| 203 | + }
|
| 204 | +
|
| 205 | + /**
|
| 206 | + * Performs SMTP authentication. Must be run after running the
|
| 207 | + * Hello() method. Returns true if successfully authenticated.
|
| 208 | + * @access public
|
| 209 | + * @return bool
|
| 210 | + */
|
| 211 | + public function Authenticate($username, $password) {
|
| 212 | + // Start authentication
|
| 213 | + fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
|
| 214 | +
|
| 215 | + $rply = $this->get_lines();
|
| 216 | + $code = substr($rply,0,3);
|
| 217 | +
|
| 218 | + if($code != 334) {
|
| 219 | + $this->error =
|
| 220 | + array("error" => "AUTH not accepted from server",
|
| 221 | + "smtp_code" => $code,
|
| 222 | + "smtp_msg" => substr($rply,4));
|
| 223 | + if($this->do_debug >= 1) {
|
| 224 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 225 | + }
|
| 226 | + return false;
|
| 227 | + }
|
| 228 | +
|
| 229 | + // Send encoded username
|
| 230 | + fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
|
| 231 | +
|
| 232 | + $rply = $this->get_lines();
|
| 233 | + $code = substr($rply,0,3);
|
| 234 | +
|
| 235 | + if($code != 334) {
|
| 236 | + $this->error =
|
| 237 | + array("error" => "Username not accepted from server",
|
| 238 | + "smtp_code" => $code,
|
| 239 | + "smtp_msg" => substr($rply,4));
|
| 240 | + if($this->do_debug >= 1) {
|
| 241 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 242 | + }
|
| 243 | + return false;
|
| 244 | + }
|
| 245 | +
|
| 246 | + // Send encoded password
|
| 247 | + fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
|
| 248 | +
|
| 249 | + $rply = $this->get_lines();
|
| 250 | + $code = substr($rply,0,3);
|
| 251 | +
|
| 252 | + if($code != 235) {
|
| 253 | + $this->error =
|
| 254 | + array("error" => "Password not accepted from server",
|
| 255 | + "smtp_code" => $code,
|
| 256 | + "smtp_msg" => substr($rply,4));
|
| 257 | + if($this->do_debug >= 1) {
|
| 258 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 259 | + }
|
| 260 | + return false;
|
| 261 | + }
|
| 262 | +
|
| 263 | + return true;
|
| 264 | + }
|
| 265 | +
|
| 266 | + /**
|
| 267 | + * Returns true if connected to a server otherwise false
|
| 268 | + * @access public
|
| 269 | + * @return bool
|
| 270 | + */
|
| 271 | + public function Connected() {
|
| 272 | + if(!empty($this->smtp_conn)) {
|
| 273 | + $sock_status = socket_get_status($this->smtp_conn);
|
| 274 | + if($sock_status["eof"]) {
|
| 275 | + // the socket is valid but we are not connected
|
| 276 | + if($this->do_debug >= 1) {
|
| 277 | + echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
|
| 278 | + }
|
| 279 | + $this->Close();
|
| 280 | + return false;
|
| 281 | + }
|
| 282 | + return true; // everything looks good
|
| 283 | + }
|
| 284 | + return false;
|
| 285 | + }
|
| 286 | +
|
| 287 | + /**
|
| 288 | + * Closes the socket and cleans up the state of the class.
|
| 289 | + * It is not considered good to use this function without
|
| 290 | + * first trying to use QUIT.
|
| 291 | + * @access public
|
| 292 | + * @return void
|
| 293 | + */
|
| 294 | + public function Close() {
|
| 295 | + $this->error = null; // so there is no confusion
|
| 296 | + $this->helo_rply = null;
|
| 297 | + if(!empty($this->smtp_conn)) {
|
| 298 | + // close the connection and cleanup
|
| 299 | + fclose($this->smtp_conn);
|
| 300 | + $this->smtp_conn = 0;
|
| 301 | + }
|
| 302 | + }
|
| 303 | +
|
| 304 | + /////////////////////////////////////////////////
|
| 305 | + // SMTP COMMANDS
|
| 306 | + /////////////////////////////////////////////////
|
| 307 | +
|
| 308 | + /**
|
| 309 | + * Issues a data command and sends the msg_data to the server
|
| 310 | + * finializing the mail transaction. $msg_data is the message
|
| 311 | + * that is to be send with the headers. Each header needs to be
|
| 312 | + * on a single line followed by a <CRLF> with the message headers
|
| 313 | + * and the message body being seperated by and additional <CRLF>.
|
| 314 | + *
|
| 315 | + * Implements rfc 821: DATA <CRLF>
|
| 316 | + *
|
| 317 | + * SMTP CODE INTERMEDIATE: 354
|
| 318 | + * [data]
|
| 319 | + * <CRLF>.<CRLF>
|
| 320 | + * SMTP CODE SUCCESS: 250
|
| 321 | + * SMTP CODE FAILURE: 552,554,451,452
|
| 322 | + * SMTP CODE FAILURE: 451,554
|
| 323 | + * SMTP CODE ERROR : 500,501,503,421
|
| 324 | + * @access public
|
| 325 | + * @return bool
|
| 326 | + */
|
| 327 | + public function Data($msg_data) {
|
| 328 | + $this->error = null; // so no confusion is caused
|
| 329 | +
|
| 330 | + if(!$this->connected()) {
|
| 331 | + $this->error = array(
|
| 332 | + "error" => "Called Data() without being connected");
|
| 333 | + return false;
|
| 334 | + }
|
| 335 | +
|
| 336 | + fputs($this->smtp_conn,"DATA" . $this->CRLF);
|
| 337 | +
|
| 338 | + $rply = $this->get_lines();
|
| 339 | + $code = substr($rply,0,3);
|
| 340 | +
|
| 341 | + if($this->do_debug >= 2) {
|
| 342 | + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
| 343 | + }
|
| 344 | +
|
| 345 | + if($code != 354) {
|
| 346 | + $this->error =
|
| 347 | + array("error" => "DATA command not accepted from server",
|
| 348 | + "smtp_code" => $code,
|
| 349 | + "smtp_msg" => substr($rply,4));
|
| 350 | + if($this->do_debug >= 1) {
|
| 351 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 352 | + }
|
| 353 | + return false;
|
| 354 | + }
|
| 355 | +
|
| 356 | + /* the server is ready to accept data!
|
| 357 | + * according to rfc 821 we should not send more than 1000
|
| 358 | + * including the CRLF
|
| 359 | + * characters on a single line so we will break the data up
|
| 360 | + * into lines by \r and/or \n then if needed we will break
|
| 361 | + * each of those into smaller lines to fit within the limit.
|
| 362 | + * in addition we will be looking for lines that start with
|
| 363 | + * a period '.' and append and additional period '.' to that
|
| 364 | + * line. NOTE: this does not count towards limit.
|
| 365 | + */
|
| 366 | +
|
| 367 | + // normalize the line breaks so we know the explode works
|
| 368 | + $msg_data = str_replace("\r\n","\n",$msg_data);
|
| 369 | + $msg_data = str_replace("\r","\n",$msg_data);
|
| 370 | + $lines = explode("\n",$msg_data);
|
| 371 | +
|
| 372 | + /* we need to find a good way to determine is headers are
|
| 373 | + * in the msg_data or if it is a straight msg body
|
| 374 | + * currently I am assuming rfc 822 definitions of msg headers
|
| 375 | + * and if the first field of the first line (':' sperated)
|
| 376 | + * does not contain a space then it _should_ be a header
|
| 377 | + * and we can process all lines before a blank "" line as
|
| 378 | + * headers.
|
| 379 | + */
|
| 380 | +
|
| 381 | + $field = substr($lines[0],0,strpos($lines[0],":"));
|
| 382 | + $in_headers = false;
|
| 383 | + if(!empty($field) && !strstr($field," ")) {
|
| 384 | + $in_headers = true;
|
| 385 | + }
|
| 386 | +
|
| 387 | + $max_line_length = 998; // used below; set here for ease in change
|
| 388 | +
|
| 389 | + while(list(,$line) = @each($lines)) {
|
| 390 | + $lines_out = null;
|
| 391 | + if($line == "" && $in_headers) {
|
| 392 | + $in_headers = false;
|
| 393 | + }
|
| 394 | + // ok we need to break this line up into several smaller lines
|
| 395 | + while(strlen($line) > $max_line_length) {
|
| 396 | + $pos = strrpos(substr($line,0,$max_line_length)," ");
|
| 397 | +
|
| 398 | + // Patch to fix DOS attack
|
| 399 | + if(!$pos) {
|
| 400 | + $pos = $max_line_length - 1;
|
| 401 | + $lines_out[] = substr($line,0,$pos);
|
| 402 | + $line = substr($line,$pos);
|
| 403 | + } else {
|
| 404 | + $lines_out[] = substr($line,0,$pos);
|
| 405 | + $line = substr($line,$pos + 1);
|
| 406 | + }
|
| 407 | +
|
| 408 | + /* if processing headers add a LWSP-char to the front of new line
|
| 409 | + * rfc 822 on long msg headers
|
| 410 | + */
|
| 411 | + if($in_headers) {
|
| 412 | + $line = "\t" . $line;
|
| 413 | + }
|
| 414 | + }
|
| 415 | + $lines_out[] = $line;
|
| 416 | +
|
| 417 | + // send the lines to the server
|
| 418 | + while(list(,$line_out) = @each($lines_out)) {
|
| 419 | + if(strlen($line_out) > 0)
|
| 420 | + {
|
| 421 | + if(substr($line_out, 0, 1) == ".") {
|
| 422 | + $line_out = "." . $line_out;
|
| 423 | + }
|
| 424 | + }
|
| 425 | + fputs($this->smtp_conn,$line_out . $this->CRLF);
|
| 426 | + }
|
| 427 | + }
|
| 428 | +
|
| 429 | + // message data has been sent
|
| 430 | + fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
|
| 431 | +
|
| 432 | + $rply = $this->get_lines();
|
| 433 | + $code = substr($rply,0,3);
|
| 434 | +
|
| 435 | + if($this->do_debug >= 2) {
|
| 436 | + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
| 437 | + }
|
| 438 | +
|
| 439 | + if($code != 250) {
|
| 440 | + $this->error =
|
| 441 | + array("error" => "DATA not accepted from server",
|
| 442 | + "smtp_code" => $code,
|
| 443 | + "smtp_msg" => substr($rply,4));
|
| 444 | + if($this->do_debug >= 1) {
|
| 445 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 446 | + }
|
| 447 | + return false;
|
| 448 | + }
|
| 449 | + return true;
|
| 450 | + }
|
| 451 | +
|
| 452 | + /**
|
| 453 | + * Sends the HELO command to the smtp server.
|
| 454 | + * This makes sure that we and the server are in
|
| 455 | + * the same known state.
|
| 456 | + *
|
| 457 | + * Implements from rfc 821: HELO <SP> <domain> <CRLF>
|
| 458 | + *
|
| 459 | + * SMTP CODE SUCCESS: 250
|
| 460 | + * SMTP CODE ERROR : 500, 501, 504, 421
|
| 461 | + * @access public
|
| 462 | + * @return bool
|
| 463 | + */
|
| 464 | + public function Hello($host = '') {
|
| 465 | + $this->error = null; // so no confusion is caused
|
| 466 | +
|
| 467 | + if(!$this->connected()) {
|
| 468 | + $this->error = array(
|
| 469 | + "error" => "Called Hello() without being connected");
|
| 470 | + return false;
|
| 471 | + }
|
| 472 | +
|
| 473 | + // if hostname for HELO was not specified send default
|
| 474 | + if(empty($host)) {
|
| 475 | + // determine appropriate default to send to server
|
| 476 | + $host = "localhost";
|
| 477 | + }
|
| 478 | +
|
| 479 | + // Send extended hello first (RFC 2821)
|
| 480 | + if(!$this->SendHello("EHLO", $host)) {
|
| 481 | + if(!$this->SendHello("HELO", $host)) {
|
| 482 | + return false;
|
| 483 | + }
|
| 484 | + }
|
| 485 | +
|
| 486 | + return true;
|
| 487 | + }
|
| 488 | +
|
| 489 | + /**
|
| 490 | + * Sends a HELO/EHLO command.
|
| 491 | + * @access private
|
| 492 | + * @return bool
|
| 493 | + */
|
| 494 | + private function SendHello($hello, $host) {
|
| 495 | + fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
|
| 496 | +
|
| 497 | + $rply = $this->get_lines();
|
| 498 | + $code = substr($rply,0,3);
|
| 499 | +
|
| 500 | + if($this->do_debug >= 2) {
|
| 501 | + echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
|
| 502 | + }
|
| 503 | +
|
| 504 | + if($code != 250) {
|
| 505 | + $this->error =
|
| 506 | + array("error" => $hello . " not accepted from server",
|
| 507 | + "smtp_code" => $code,
|
| 508 | + "smtp_msg" => substr($rply,4));
|
| 509 | + if($this->do_debug >= 1) {
|
| 510 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 511 | + }
|
| 512 | + return false;
|
| 513 | + }
|
| 514 | +
|
| 515 | + $this->helo_rply = $rply;
|
| 516 | +
|
| 517 | + return true;
|
| 518 | + }
|
| 519 | +
|
| 520 | + /**
|
| 521 | + * Starts a mail transaction from the email address specified in
|
| 522 | + * $from. Returns true if successful or false otherwise. If True
|
| 523 | + * the mail transaction is started and then one or more Recipient
|
| 524 | + * commands may be called followed by a Data command.
|
| 525 | + *
|
| 526 | + * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
|
| 527 | + *
|
| 528 | + * SMTP CODE SUCCESS: 250
|
| 529 | + * SMTP CODE SUCCESS: 552,451,452
|
| 530 | + * SMTP CODE SUCCESS: 500,501,421
|
| 531 | + * @access public
|
| 532 | + * @return bool
|
| 533 | + */
|
| 534 | + public function Mail($from) {
|
| 535 | + $this->error = null; // so no confusion is caused
|
| 536 | +
|
| 537 | + if(!$this->connected()) {
|
| 538 | + $this->error = array(
|
| 539 | + "error" => "Called Mail() without being connected");
|
| 540 | + return false;
|
| 541 | + }
|
| 542 | +
|
| 543 | + $useVerp = ($this->do_verp ? "XVERP" : "");
|
| 544 | + fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
|
| 545 | +
|
| 546 | + $rply = $this->get_lines();
|
| 547 | + $code = substr($rply,0,3);
|
| 548 | +
|
| 549 | + if($this->do_debug >= 2) {
|
| 550 | + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
| 551 | + }
|
| 552 | +
|
| 553 | + if($code != 250) {
|
| 554 | + $this->error =
|
| 555 | + array("error" => "MAIL not accepted from server",
|
| 556 | + "smtp_code" => $code,
|
| 557 | + "smtp_msg" => substr($rply,4));
|
| 558 | + if($this->do_debug >= 1) {
|
| 559 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 560 | + }
|
| 561 | + return false;
|
| 562 | + }
|
| 563 | + return true;
|
| 564 | + }
|
| 565 | +
|
| 566 | + /**
|
| 567 | + * Sends the quit command to the server and then closes the socket
|
| 568 | + * if there is no error or the $close_on_error argument is true.
|
| 569 | + *
|
| 570 | + * Implements from rfc 821: QUIT <CRLF>
|
| 571 | + *
|
| 572 | + * SMTP CODE SUCCESS: 221
|
| 573 | + * SMTP CODE ERROR : 500
|
| 574 | + * @access public
|
| 575 | + * @return bool
|
| 576 | + */
|
| 577 | + public function Quit($close_on_error = true) {
|
| 578 | + $this->error = null; // so there is no confusion
|
| 579 | +
|
| 580 | + if(!$this->connected()) {
|
| 581 | + $this->error = array(
|
| 582 | + "error" => "Called Quit() without being connected");
|
| 583 | + return false;
|
| 584 | + }
|
| 585 | +
|
| 586 | + // send the quit command to the server
|
| 587 | + fputs($this->smtp_conn,"quit" . $this->CRLF);
|
| 588 | +
|
| 589 | + // get any good-bye messages
|
| 590 | + $byemsg = $this->get_lines();
|
| 591 | +
|
| 592 | + if($this->do_debug >= 2) {
|
| 593 | + echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
|
| 594 | + }
|
| 595 | +
|
| 596 | + $rval = true;
|
| 597 | + $e = null;
|
| 598 | +
|
| 599 | + $code = substr($byemsg,0,3);
|
| 600 | + if($code != 221) {
|
| 601 | + // use e as a tmp var cause Close will overwrite $this->error
|
| 602 | + $e = array("error" => "SMTP server rejected quit command",
|
| 603 | + "smtp_code" => $code,
|
| 604 | + "smtp_rply" => substr($byemsg,4));
|
| 605 | + $rval = false;
|
| 606 | + if($this->do_debug >= 1) {
|
| 607 | + echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
|
| 608 | + }
|
| 609 | + }
|
| 610 | +
|
| 611 | + if(empty($e) || $close_on_error) {
|
| 612 | + $this->Close();
|
| 613 | + }
|
| 614 | +
|
| 615 | + return $rval;
|
| 616 | + }
|
| 617 | +
|
| 618 | + /**
|
| 619 | + * Sends the command RCPT to the SMTP server with the TO: argument of $to.
|
| 620 | + * Returns true if the recipient was accepted false if it was rejected.
|
| 621 | + *
|
| 622 | + * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
|
| 623 | + *
|
| 624 | + * SMTP CODE SUCCESS: 250,251
|
| 625 | + * SMTP CODE FAILURE: 550,551,552,553,450,451,452
|
| 626 | + * SMTP CODE ERROR : 500,501,503,421
|
| 627 | + * @access public
|
| 628 | + * @return bool
|
| 629 | + */
|
| 630 | + public function Recipient($to) {
|
| 631 | + $this->error = null; // so no confusion is caused
|
| 632 | +
|
| 633 | + if(!$this->connected()) {
|
| 634 | + $this->error = array(
|
| 635 | + "error" => "Called Recipient() without being connected");
|
| 636 | + return false;
|
| 637 | + }
|
| 638 | +
|
| 639 | + fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
|
| 640 | +
|
| 641 | + $rply = $this->get_lines();
|
| 642 | + $code = substr($rply,0,3);
|
| 643 | +
|
| 644 | + if($this->do_debug >= 2) {
|
| 645 | + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
| 646 | + }
|
| 647 | +
|
| 648 | + if($code != 250 && $code != 251) {
|
| 649 | + $this->error =
|
| 650 | + array("error" => "RCPT not accepted from server",
|
| 651 | + "smtp_code" => $code,
|
| 652 | + "smtp_msg" => substr($rply,4));
|
| 653 | + if($this->do_debug >= 1) {
|
| 654 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 655 | + }
|
| 656 | + return false;
|
| 657 | + }
|
| 658 | + return true;
|
| 659 | + }
|
| 660 | +
|
| 661 | + /**
|
| 662 | + * Sends the RSET command to abort and transaction that is
|
| 663 | + * currently in progress. Returns true if successful false
|
| 664 | + * otherwise.
|
| 665 | + *
|
| 666 | + * Implements rfc 821: RSET <CRLF>
|
| 667 | + *
|
| 668 | + * SMTP CODE SUCCESS: 250
|
| 669 | + * SMTP CODE ERROR : 500,501,504,421
|
| 670 | + * @access public
|
| 671 | + * @return bool
|
| 672 | + */
|
| 673 | + public function Reset() {
|
| 674 | + $this->error = null; // so no confusion is caused
|
| 675 | +
|
| 676 | + if(!$this->connected()) {
|
| 677 | + $this->error = array(
|
| 678 | + "error" => "Called Reset() without being connected");
|
| 679 | + return false;
|
| 680 | + }
|
| 681 | +
|
| 682 | + fputs($this->smtp_conn,"RSET" . $this->CRLF);
|
| 683 | +
|
| 684 | + $rply = $this->get_lines();
|
| 685 | + $code = substr($rply,0,3);
|
| 686 | +
|
| 687 | + if($this->do_debug >= 2) {
|
| 688 | + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
| 689 | + }
|
| 690 | +
|
| 691 | + if($code != 250) {
|
| 692 | + $this->error =
|
| 693 | + array("error" => "RSET failed",
|
| 694 | + "smtp_code" => $code,
|
| 695 | + "smtp_msg" => substr($rply,4));
|
| 696 | + if($this->do_debug >= 1) {
|
| 697 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 698 | + }
|
| 699 | + return false;
|
| 700 | + }
|
| 701 | +
|
| 702 | + return true;
|
| 703 | + }
|
| 704 | +
|
| 705 | + /**
|
| 706 | + * Starts a mail transaction from the email address specified in
|
| 707 | + * $from. Returns true if successful or false otherwise. If True
|
| 708 | + * the mail transaction is started and then one or more Recipient
|
| 709 | + * commands may be called followed by a Data command. This command
|
| 710 | + * will send the message to the users terminal if they are logged
|
| 711 | + * in and send them an email.
|
| 712 | + *
|
| 713 | + * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
|
| 714 | + *
|
| 715 | + * SMTP CODE SUCCESS: 250
|
| 716 | + * SMTP CODE SUCCESS: 552,451,452
|
| 717 | + * SMTP CODE SUCCESS: 500,501,502,421
|
| 718 | + * @access public
|
| 719 | + * @return bool
|
| 720 | + */
|
| 721 | + public function SendAndMail($from) {
|
| 722 | + $this->error = null; // so no confusion is caused
|
| 723 | +
|
| 724 | + if(!$this->connected()) {
|
| 725 | + $this->error = array(
|
| 726 | + "error" => "Called SendAndMail() without being connected");
|
| 727 | + return false;
|
| 728 | + }
|
| 729 | +
|
| 730 | + fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
|
| 731 | +
|
| 732 | + $rply = $this->get_lines();
|
| 733 | + $code = substr($rply,0,3);
|
| 734 | +
|
| 735 | + if($this->do_debug >= 2) {
|
| 736 | + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
|
| 737 | + }
|
| 738 | +
|
| 739 | + if($code != 250) {
|
| 740 | + $this->error =
|
| 741 | + array("error" => "SAML not accepted from server",
|
| 742 | + "smtp_code" => $code,
|
| 743 | + "smtp_msg" => substr($rply,4));
|
| 744 | + if($this->do_debug >= 1) {
|
| 745 | + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
|
| 746 | + }
|
| 747 | + return false;
|
| 748 | + }
|
| 749 | + return true;
|
| 750 | + }
|
| 751 | +
|
| 752 | + /**
|
| 753 | + * This is an optional command for SMTP that this class does not
|
| 754 | + * support. This method is here to make the RFC821 Definition
|
| 755 | + * complete for this class and __may__ be implimented in the future
|
| 756 | + *
|
| 757 | + * Implements from rfc 821: TURN <CRLF>
|
| 758 | + *
|
| 759 | + * SMTP CODE SUCCESS: 250
|
| 760 | + * SMTP CODE FAILURE: 502
|
| 761 | + * SMTP CODE ERROR : 500, 503
|
| 762 | + * @access public
|
| 763 | + * @return bool
|
| 764 | + */
|
| 765 | + public function Turn() {
|
| 766 | + $this->error = array("error" => "This method, TURN, of the SMTP ".
|
| 767 | + "is not implemented");
|
| 768 | + if($this->do_debug >= 1) {
|
| 769 | + echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
|
| 770 | + }
|
| 771 | + return false;
|
| 772 | + }
|
| 773 | +
|
| 774 | + /**
|
| 775 | + * Get the current error
|
| 776 | + * @access public
|
| 777 | + * @return array
|
| 778 | + */
|
| 779 | + public function getError() {
|
| 780 | + return $this->error;
|
| 781 | + }
|
| 782 | +
|
| 783 | + /////////////////////////////////////////////////
|
| 784 | + // INTERNAL FUNCTIONS
|
| 785 | + /////////////////////////////////////////////////
|
| 786 | +
|
| 787 | + /**
|
| 788 | + * Read in as many lines as possible
|
| 789 | + * either before eof or socket timeout occurs on the operation.
|
| 790 | + * With SMTP we can tell if we have more lines to read if the
|
| 791 | + * 4th character is '-' symbol. If it is a space then we don't
|
| 792 | + * need to read anything else.
|
| 793 | + * @access private
|
| 794 | + * @return string
|
| 795 | + */
|
| 796 | + private function get_lines() {
|
| 797 | + $data = "";
|
| 798 | + while($str = @fgets($this->smtp_conn,515)) {
|
| 799 | + if($this->do_debug >= 4) {
|
| 800 | + echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
|
| 801 | + echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
|
| 802 | + }
|
| 803 | + $data .= $str;
|
| 804 | + if($this->do_debug >= 4) {
|
| 805 | + echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
|
| 806 | + }
|
| 807 | + // if 4th character is a space, we are done reading, break the loop
|
| 808 | + if(substr($str,3,1) == " ") { break; }
|
| 809 | + }
|
| 810 | + return $data;
|
| 811 | + }
|
| 812 | +
|
| 813 | +}
|
| 814 | +
|
| 815 | +?> |
\ No newline at end of file |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/class.smtp.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 816 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_sendmail_basic.php |
— | — | @@ -0,0 +1,45 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - Sendmail basic test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +
|
| 10 | +require_once('../class.phpmailer.php');
|
| 11 | +
|
| 12 | +$mail = new PHPMailer(); // defaults to using php "mail()"
|
| 13 | +
|
| 14 | +$mail->IsSendmail(); // telling the class to use SendMail transport
|
| 15 | +
|
| 16 | +$body = file_get_contents('contents.html');
|
| 17 | +$body = eregi_replace("[\]",'',$body);
|
| 18 | +
|
| 19 | +$mail->AddReplyTo("name@yourdomain.com","First Last");
|
| 20 | +
|
| 21 | +$mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 22 | +
|
| 23 | +$mail->AddReplyTo("name@yourdomain.com","First Last");
|
| 24 | +
|
| 25 | +$address = "whoto@otherdomain.com";
|
| 26 | +$mail->AddAddress($address, "John Doe");
|
| 27 | +
|
| 28 | +$mail->Subject = "PHPMailer Test Subject via Sendmail, basic";
|
| 29 | +
|
| 30 | +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
| 31 | +
|
| 32 | +$mail->MsgHTML($body);
|
| 33 | +
|
| 34 | +$mail->AddAttachment("images/phpmailer.gif"); // attachment
|
| 35 | +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
|
| 36 | +
|
| 37 | +if(!$mail->Send()) {
|
| 38 | + echo "Mailer Error: " . $mail->ErrorInfo;
|
| 39 | +} else {
|
| 40 | + echo "Message sent!";
|
| 41 | +}
|
| 42 | +
|
| 43 | +?>
|
| 44 | +
|
| 45 | +</body>
|
| 46 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_sendmail_basic.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 47 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_gmail_basic.php |
— | — | @@ -0,0 +1,59 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - SMTP (Gmail) basic test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +
|
| 10 | +//error_reporting(E_ALL);
|
| 11 | +error_reporting(E_STRICT);
|
| 12 | +
|
| 13 | +date_default_timezone_set('America/Toronto');
|
| 14 | +
|
| 15 | +require_once('../class.phpmailer.php');
|
| 16 | +//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
|
| 17 | +
|
| 18 | +$mail = new PHPMailer();
|
| 19 | +
|
| 20 | +$body = file_get_contents('contents.html');
|
| 21 | +$body = eregi_replace("[\]",'',$body);
|
| 22 | +
|
| 23 | +$mail->IsSMTP(); // telling the class to use SMTP
|
| 24 | +$mail->Host = "mail.yourdomain.com"; // SMTP server
|
| 25 | +$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
|
| 26 | + // 1 = errors and messages
|
| 27 | + // 2 = messages only
|
| 28 | +$mail->SMTPAuth = true; // enable SMTP authentication
|
| 29 | +$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
|
| 30 | +$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
|
| 31 | +$mail->Port = 465; // set the SMTP port for the GMAIL server
|
| 32 | +$mail->Username = "yourusername@gmail.com"; // GMAIL username
|
| 33 | +$mail->Password = "yourpassword"; // GMAIL password
|
| 34 | +
|
| 35 | +$mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 36 | +
|
| 37 | +$mail->AddReplyTo("name@yourdomain.com","First Last");
|
| 38 | +
|
| 39 | +$mail->Subject = "PHPMailer Test Subject via smtp (Gmail), basic";
|
| 40 | +
|
| 41 | +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
| 42 | +
|
| 43 | +$mail->MsgHTML($body);
|
| 44 | +
|
| 45 | +$address = "whoto@otherdomain.com";
|
| 46 | +$mail->AddAddress($address, "John Doe");
|
| 47 | +
|
| 48 | +$mail->AddAttachment("images/phpmailer.gif"); // attachment
|
| 49 | +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
|
| 50 | +
|
| 51 | +if(!$mail->Send()) {
|
| 52 | + echo "Mailer Error: " . $mail->ErrorInfo;
|
| 53 | +} else {
|
| 54 | + echo "Message sent!";
|
| 55 | +}
|
| 56 | +
|
| 57 | +?>
|
| 58 | +
|
| 59 | +</body>
|
| 60 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_gmail_basic.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 61 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_basic_no_auth.php |
— | — | @@ -0,0 +1,53 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - SMTP basic test with no authentication</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +
|
| 10 | +//error_reporting(E_ALL);
|
| 11 | +error_reporting(E_STRICT);
|
| 12 | +
|
| 13 | +date_default_timezone_set('America/Toronto');
|
| 14 | +
|
| 15 | +require_once('../class.phpmailer.php');
|
| 16 | +//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
|
| 17 | +
|
| 18 | +$mail = new PHPMailer();
|
| 19 | +
|
| 20 | +$body = file_get_contents('contents.html');
|
| 21 | +$body = eregi_replace("[\]",'',$body);
|
| 22 | +
|
| 23 | +$mail->IsSMTP(); // telling the class to use SMTP
|
| 24 | +$mail->Host = "mail.yourdomain.com"; // SMTP server
|
| 25 | +$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
|
| 26 | + // 1 = errors and messages
|
| 27 | + // 2 = messages only
|
| 28 | +
|
| 29 | +$mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 30 | +
|
| 31 | +$mail->AddReplyTo("name@yourdomain.com","First Last");
|
| 32 | +
|
| 33 | +$mail->Subject = "PHPMailer Test Subject via smtp, basic with no authentication";
|
| 34 | +
|
| 35 | +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
| 36 | +
|
| 37 | +$mail->MsgHTML($body);
|
| 38 | +
|
| 39 | +$address = "whoto@otherdomain.com";
|
| 40 | +$mail->AddAddress($address, "John Doe");
|
| 41 | +
|
| 42 | +$mail->AddAttachment("images/phpmailer.gif"); // attachment
|
| 43 | +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
|
| 44 | +
|
| 45 | +if(!$mail->Send()) {
|
| 46 | + echo "Mailer Error: " . $mail->ErrorInfo;
|
| 47 | +} else {
|
| 48 | + echo "Message sent!";
|
| 49 | +}
|
| 50 | +
|
| 51 | +?>
|
| 52 | +
|
| 53 | +</body>
|
| 54 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_basic_no_auth.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 55 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_mail_advanced.php |
— | — | @@ -0,0 +1,31 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - Mail() advanced test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +require_once '../class.phpmailer.php';
|
| 10 | +
|
| 11 | +$mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
|
| 12 | +
|
| 13 | +try {
|
| 14 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 15 | + $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
|
| 16 | + $mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 17 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 18 | + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
|
| 19 | + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
|
| 20 | + $mail->MsgHTML(file_get_contents('contents.html'));
|
| 21 | + $mail->AddAttachment('images/phpmailer.gif'); // attachment
|
| 22 | + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
|
| 23 | + $mail->Send();
|
| 24 | + echo "Message Sent OK</p>\n";
|
| 25 | +} catch (phpmailerException $e) {
|
| 26 | + echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
| 27 | +} catch (Exception $e) {
|
| 28 | + echo $e->getMessage(); //Boring error messages from anything else!
|
| 29 | +}
|
| 30 | +?>
|
| 31 | +</body>
|
| 32 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_mail_advanced.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 33 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_pop_before_smtp_advanced.php |
— | — | @@ -0,0 +1,40 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>POP before SMTP Test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +require_once('../class.phpmailer.php');
|
| 10 | +require_once('../class.pop3.php'); // required for POP before SMTP
|
| 11 | +
|
| 12 | +$pop = new POP3();
|
| 13 | +$pop->Authorise('pop3.yourdomain.com', 110, 30, 'username', 'password', 1);
|
| 14 | +
|
| 15 | +$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
|
| 16 | +
|
| 17 | +$mail->IsSMTP();
|
| 18 | +
|
| 19 | +try {
|
| 20 | + $mail->SMTPDebug = 2;
|
| 21 | + $mail->Host = 'pop3.yourdomain.com';
|
| 22 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 23 | + $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
|
| 24 | + $mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 25 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 26 | + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
|
| 27 | + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
|
| 28 | + $mail->MsgHTML(file_get_contents('contents.html'));
|
| 29 | + $mail->AddAttachment('images/phpmailer.gif'); // attachment
|
| 30 | + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
|
| 31 | + $mail->Send();
|
| 32 | + echo "Message Sent OK</p>\n";
|
| 33 | +} catch (phpmailerException $e) {
|
| 34 | + echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
| 35 | +} catch (Exception $e) {
|
| 36 | + echo $e->getMessage(); //Boring error messages from anything else!
|
| 37 | +}
|
| 38 | +?>
|
| 39 | +
|
| 40 | +</body>
|
| 41 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_pop_before_smtp_advanced.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 42 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_advanced.php |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - SMTP advanced test with authentication</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +
|
| 10 | +require_once('../class.phpmailer.php');
|
| 11 | +//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
|
| 12 | +
|
| 13 | +$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
|
| 14 | +
|
| 15 | +$mail->IsSMTP(); // telling the class to use SMTP
|
| 16 | +
|
| 17 | +try {
|
| 18 | + $mail->Host = "mail.yourdomain.com"; // SMTP server
|
| 19 | + $mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
|
| 20 | + $mail->SMTPAuth = true; // enable SMTP authentication
|
| 21 | + $mail->Host = "mail.yourdomain.com"; // sets the SMTP server
|
| 22 | + $mail->Port = 26; // set the SMTP port for the GMAIL server
|
| 23 | + $mail->Username = "yourname@yourdomain"; // SMTP account username
|
| 24 | + $mail->Password = "yourpassword"; // SMTP account password
|
| 25 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 26 | + $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
|
| 27 | + $mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 28 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 29 | + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
|
| 30 | + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
|
| 31 | + $mail->MsgHTML(file_get_contents('contents.html'));
|
| 32 | + $mail->AddAttachment('images/phpmailer.gif'); // attachment
|
| 33 | + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
|
| 34 | + $mail->Send();
|
| 35 | + echo "Message Sent OK</p>\n";
|
| 36 | +} catch (phpmailerException $e) {
|
| 37 | + echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
| 38 | +} catch (Exception $e) {
|
| 39 | + echo $e->getMessage(); //Boring error messages from anything else!
|
| 40 | +}
|
| 41 | +?>
|
| 42 | +
|
| 43 | +</body>
|
| 44 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_advanced.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 45 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/contents.html |
— | — | @@ -0,0 +1,20 @@ |
| 2 | +<body style="margin: 10px;">
|
| 3 | +<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
|
| 4 | +<div align="center"><img src="images/phpmailer.gif" style="height: 90px; width: 340px"></div><br>
|
| 5 | +<br>
|
| 6 | + This is a test of PHPMailer.<br>
|
| 7 | +<br>
|
| 8 | +This particular example uses <strong>HTML</strong>, with a <div> tag and inline<br>
|
| 9 | +styles.<br>
|
| 10 | +<br>
|
| 11 | +Also note the use of the PHPMailer logo above with no specific code to handle
|
| 12 | +including it.<br />
|
| 13 | +Included are two attachments:<br />
|
| 14 | +phpmailer.gif is an attachment and used inline as a graphic (above)<br />
|
| 15 | +phpmailer_mini.gif is an attachment<br />
|
| 16 | +<br />
|
| 17 | +PHPMailer:<br />
|
| 18 | +Author: Andy Prevost (codeworxtech@users.sourceforge.net)<br />
|
| 19 | +Author: Marcus Bointon (coolbru@users.sourceforge.net)<br />
|
| 20 | +</div>
|
| 21 | +</body>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/contents.html |
___________________________________________________________________ |
Added: svn:executable |
1 | 22 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/images/phpmailer_mini.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/images/phpmailer_mini.gif |
___________________________________________________________________ |
Added: svn:mime-type |
2 | 23 | + application/octet-stream |
Added: svn:executable |
3 | 24 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/images/phpmailer.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/images/phpmailer.gif |
___________________________________________________________________ |
Added: svn:mime-type |
4 | 25 | + application/octet-stream |
Added: svn:executable |
5 | 26 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_sendmail_advanced.php |
— | — | @@ -0,0 +1,34 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - Sendmail advanced test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +
|
| 10 | +require_once('../class.phpmailer.php');
|
| 11 | +
|
| 12 | +$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
|
| 13 | +$mail->IsSendmail(); // telling the class to use SendMail transport
|
| 14 | +
|
| 15 | +try {
|
| 16 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 17 | + $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
|
| 18 | + $mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 19 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 20 | + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
|
| 21 | + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
|
| 22 | + $mail->MsgHTML(file_get_contents('contents.html'));
|
| 23 | + $mail->AddAttachment('images/phpmailer.gif'); // attachment
|
| 24 | + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
|
| 25 | + $mail->Send();
|
| 26 | + echo "Message Sent OK</p>\n";
|
| 27 | +} catch (phpmailerException $e) {
|
| 28 | + echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
| 29 | +} catch (Exception $e) {
|
| 30 | + echo $e->getMessage(); //Boring error messages from anything else!
|
| 31 | +}
|
| 32 | +?>
|
| 33 | +
|
| 34 | +</body>
|
| 35 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_sendmail_advanced.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 36 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_gmail_advanced.php |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - SMTP (Gmail) advanced test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +require_once('../class.phpmailer.php');
|
| 10 | +//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
|
| 11 | +
|
| 12 | +$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
|
| 13 | +
|
| 14 | +$mail->IsSMTP(); // telling the class to use SMTP
|
| 15 | +
|
| 16 | +try {
|
| 17 | + $mail->Host = "mail.yourdomain.com"; // SMTP server
|
| 18 | + $mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
|
| 19 | + $mail->SMTPAuth = true; // enable SMTP authentication
|
| 20 | + $mail->SMTPSecure = "ssl"; // sets the prefix to the servier
|
| 21 | + $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
|
| 22 | + $mail->Port = 465; // set the SMTP port for the GMAIL server
|
| 23 | + $mail->Username = "yourusername@gmail.com"; // GMAIL username
|
| 24 | + $mail->Password = "yourpassword"; // GMAIL password
|
| 25 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 26 | + $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
|
| 27 | + $mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 28 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 29 | + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
|
| 30 | + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
|
| 31 | + $mail->MsgHTML(file_get_contents('contents.html'));
|
| 32 | + $mail->AddAttachment('images/phpmailer.gif'); // attachment
|
| 33 | + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
|
| 34 | + $mail->Send();
|
| 35 | + echo "Message Sent OK</p>\n";
|
| 36 | +} catch (phpmailerException $e) {
|
| 37 | + echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
| 38 | +} catch (Exception $e) {
|
| 39 | + echo $e->getMessage(); //Boring error messages from anything else!
|
| 40 | +}
|
| 41 | +?>
|
| 42 | +
|
| 43 | +</body>
|
| 44 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_gmail_advanced.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 45 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_mail_basic.php |
— | — | @@ -0,0 +1,43 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - Mail() basic test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +
|
| 10 | +require_once('../class.phpmailer.php');
|
| 11 | +
|
| 12 | +$mail = new PHPMailer(); // defaults to using php "mail()"
|
| 13 | +
|
| 14 | +$body = file_get_contents('contents.html');
|
| 15 | +$body = eregi_replace("[\]",'',$body);
|
| 16 | +
|
| 17 | +$mail->AddReplyTo("name@yourdomain.com","First Last");
|
| 18 | +
|
| 19 | +$mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 20 | +
|
| 21 | +$mail->AddReplyTo("name@yourdomain.com","First Last");
|
| 22 | +
|
| 23 | +$address = "whoto@otherdomain.com";
|
| 24 | +$mail->AddAddress($address, "John Doe");
|
| 25 | +
|
| 26 | +$mail->Subject = "PHPMailer Test Subject via mail(), basic";
|
| 27 | +
|
| 28 | +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
| 29 | +
|
| 30 | +$mail->MsgHTML($body);
|
| 31 | +
|
| 32 | +$mail->AddAttachment("images/phpmailer.gif"); // attachment
|
| 33 | +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
|
| 34 | +
|
| 35 | +if(!$mail->Send()) {
|
| 36 | + echo "Mailer Error: " . $mail->ErrorInfo;
|
| 37 | +} else {
|
| 38 | + echo "Message sent!";
|
| 39 | +}
|
| 40 | +
|
| 41 | +?>
|
| 42 | +
|
| 43 | +</body>
|
| 44 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_mail_basic.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 45 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_pop_before_smtp_basic.php |
— | — | @@ -0,0 +1,49 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>POP before SMTP Test</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +require_once('../class.phpmailer.php');
|
| 10 | +require_once('../class.pop3.php'); // required for POP before SMTP
|
| 11 | +
|
| 12 | +$pop = new POP3();
|
| 13 | +$pop->Authorise('pop3.yourdomain.com', 110, 30, 'username', 'password', 1);
|
| 14 | +
|
| 15 | +$mail = new PHPMailer();
|
| 16 | +
|
| 17 | +$body = file_get_contents('contents.html');
|
| 18 | +$body = eregi_replace("[\]",'',$body);
|
| 19 | +
|
| 20 | +$mail->IsSMTP();
|
| 21 | +$mail->SMTPDebug = 2;
|
| 22 | +$mail->Host = 'pop3.yourdomain.com';
|
| 23 | +
|
| 24 | +$mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 25 | +
|
| 26 | +$mail->AddReplyTo("name@yourdomain.com","First Last");
|
| 27 | +
|
| 28 | +$mail->Subject = "PHPMailer Test Subject via POP before SMTP, basic";
|
| 29 | +
|
| 30 | +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
| 31 | +
|
| 32 | +$mail->MsgHTML($body);
|
| 33 | +
|
| 34 | +$address = "whoto@otherdomain.com";
|
| 35 | +$mail->AddAddress($address, "John Doe");
|
| 36 | +
|
| 37 | +$mail->AddAttachment("images/phpmailer.gif"); // attachment
|
| 38 | +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
|
| 39 | +
|
| 40 | +
|
| 41 | +if(!$mail->Send()) {
|
| 42 | + echo "Mailer Error: " . $mail->ErrorInfo;
|
| 43 | +} else {
|
| 44 | + echo "Message sent!";
|
| 45 | +}
|
| 46 | +
|
| 47 | +?>
|
| 48 | +
|
| 49 | +</body>
|
| 50 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_pop_before_smtp_basic.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 51 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_basic.php |
— | — | @@ -0,0 +1,58 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - SMTP basic test with authentication</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +
|
| 10 | +//error_reporting(E_ALL);
|
| 11 | +error_reporting(E_STRICT);
|
| 12 | +
|
| 13 | +date_default_timezone_set('America/Toronto');
|
| 14 | +
|
| 15 | +require_once('../class.phpmailer.php');
|
| 16 | +//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
|
| 17 | +
|
| 18 | +$mail = new PHPMailer();
|
| 19 | +
|
| 20 | +$body = file_get_contents('contents.html');
|
| 21 | +$body = eregi_replace("[\]",'',$body);
|
| 22 | +
|
| 23 | +$mail->IsSMTP(); // telling the class to use SMTP
|
| 24 | +$mail->Host = "mail.yourdomain.com"; // SMTP server
|
| 25 | +$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
|
| 26 | + // 1 = errors and messages
|
| 27 | + // 2 = messages only
|
| 28 | +$mail->SMTPAuth = true; // enable SMTP authentication
|
| 29 | +$mail->Host = "mail.yourdomain.com"; // sets the SMTP server
|
| 30 | +$mail->Port = 26; // set the SMTP port for the GMAIL server
|
| 31 | +$mail->Username = "yourname@yourdomain"; // SMTP account username
|
| 32 | +$mail->Password = "yourpassword"; // SMTP account password
|
| 33 | +
|
| 34 | +$mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 35 | +
|
| 36 | +$mail->AddReplyTo("name@yourdomain.com","First Last");
|
| 37 | +
|
| 38 | +$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
|
| 39 | +
|
| 40 | +$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
| 41 | +
|
| 42 | +$mail->MsgHTML($body);
|
| 43 | +
|
| 44 | +$address = "whoto@otherdomain.com";
|
| 45 | +$mail->AddAddress($address, "John Doe");
|
| 46 | +
|
| 47 | +$mail->AddAttachment("images/phpmailer.gif"); // attachment
|
| 48 | +$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
|
| 49 | +
|
| 50 | +if(!$mail->Send()) {
|
| 51 | + echo "Mailer Error: " . $mail->ErrorInfo;
|
| 52 | +} else {
|
| 53 | + echo "Message sent!";
|
| 54 | +}
|
| 55 | +
|
| 56 | +?>
|
| 57 | +
|
| 58 | +</body>
|
| 59 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_basic.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 60 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/index.html |
— | — | @@ -0,0 +1,49 @@ |
| 2 | +This release of PHPMailer (v5.0.0) sets a new milestone in the development
|
| 3 | +cycle of PHPMailer. First, class.phpmailer.php has a small footprint (65.7 Kb),
|
| 4 | +while class.smtp.php is even smaller than before (at only 25.0 Kb).<br />
|
| 5 | +<br />
|
| 6 | +We have maintained all functionality and added Exception handling unique to
|
| 7 | +PHP 5/6.<br />
|
| 8 | +<br />
|
| 9 | +There is only one function that has been removed: that is getFile(). The reason
|
| 10 | +for this is that getFile() became a wrapper for the PHP function 'file_get_contents()'
|
| 11 | +and nothing more. Rather than burden the class with a function already available
|
| 12 | +in PHP, we decided to remove it.<br />
|
| 13 | +<br />
|
| 14 | +Our new Exception handling provides your own scripts far more power than ever.<br />
|
| 15 | +<br />
|
| 16 | +We have also enhanced the "packaging" of PHPMailer with an entirely new set of
|
| 17 | +examples. Included are both basic and advanced examples showing how you can take
|
| 18 | +advantage of PHP Exception handling to improve your own scripts.<br />
|
| 19 | +<br />
|
| 20 | +A few things to note about PHPMailer:
|
| 21 | +<ul>
|
| 22 | + <li>the use of $mail->AltBody is completely optional. If not used, PHPMailer
|
| 23 | + will use the HTML text with htmlentities().<br />
|
| 24 | + We also highly recommend using HTML2Text authored by Jon Abernathy. The class description
|
| 25 | + and download can be viewed at: http://www.chuggnutt.com/html2text.php.
|
| 26 | + </li>
|
| 27 | + <li>there is no specific code to define image or attachment types ... that is handled
|
| 28 | + automatically by PHPMailer when it parses the images</li>
|
| 29 | +</ul>
|
| 30 | +A note to users that want to use SMTP with PHPMailer. The most common problems are:
|
| 31 | +<ul>
|
| 32 | + <li>wrong port ... most ISP (Internet Service Providers) will not allow relaying through
|
| 33 | + their servers. If that's the case with your ISP, try using port 26.
|
| 34 | + </li>
|
| 35 | + <li>wrong authentication information (username and/or password) ... don't forget that
|
| 36 | + many servers require the account name to be in the format of the full email address.
|
| 37 | + </li>
|
| 38 | + <li>... if these tips do not get your SMTP settings working, we have a debug mode
|
| 39 | + for helping you determine the problem. Insert this after $mail->IsSMTP();<br />
|
| 40 | + $mail->SMTPDebug = 2; // enables SMTP debug information (for testing)<br />
|
| 41 | + note that a setting of 2 will display all errors and messages generated by the SMTP
|
| 42 | + server<br />
|
| 43 | + </li>
|
| 44 | +</ul>
|
| 45 | +Our examples all use an HTML file in the /examples folder. To see what the email SHOULD
|
| 46 | +look like in your HTML compatible email viewer: <a href="contents.html">click here</a><br>
|
| 47 | +<br />
|
| 48 | +From the PHPMailer team:<br />
|
| 49 | +Author: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net (and Project Administrator)<br />
|
| 50 | +Author: Marcus Bointon (coolbru) coolbru@users.sourceforge.net<br />
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/index.html |
___________________________________________________________________ |
Added: svn:executable |
1 | 51 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_advanced_no_auth.php |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - SMTP advanced test with no authentication</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +require_once('../class.phpmailer.php');
|
| 10 | +//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
|
| 11 | +
|
| 12 | +$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
|
| 13 | +
|
| 14 | +$mail->IsSMTP(); // telling the class to use SMTP
|
| 15 | +
|
| 16 | +try {
|
| 17 | + $mail->Host = "mail.yourdomain.com"; // SMTP server
|
| 18 | + $mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
|
| 19 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 20 | + $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
|
| 21 | + $mail->SetFrom('name@yourdomain.com', 'First Last');
|
| 22 | + $mail->AddReplyTo('name@yourdomain.com', 'First Last');
|
| 23 | + $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
|
| 24 | + $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
|
| 25 | + $mail->MsgHTML(file_get_contents('contents.html'));
|
| 26 | + $mail->AddAttachment('images/phpmailer.gif'); // attachment
|
| 27 | + $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
|
| 28 | + $mail->Send();
|
| 29 | + echo "Message Sent OK</p>\n";
|
| 30 | +} catch (phpmailerException $e) {
|
| 31 | + echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
| 32 | +} catch (Exception $e) {
|
| 33 | + echo $e->getMessage(); //Boring error messages from anything else!
|
| 34 | +}
|
| 35 | +?>
|
| 36 | +
|
| 37 | +</body>
|
| 38 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_smtp_advanced_no_auth.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 39 | + * |
Index: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_db_smtp_basic.php |
— | — | @@ -0,0 +1,58 @@ |
| 2 | +<html>
|
| 3 | +<head>
|
| 4 | +<title>PHPMailer - MySQL Database - SMTP basic test with authentication</title>
|
| 5 | +</head>
|
| 6 | +<body>
|
| 7 | +
|
| 8 | +<?php
|
| 9 | +
|
| 10 | +//error_reporting(E_ALL);
|
| 11 | +error_reporting(E_STRICT);
|
| 12 | +
|
| 13 | +date_default_timezone_set('America/Toronto');
|
| 14 | +
|
| 15 | +require_once('../class.phpmailer.php');
|
| 16 | +//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
|
| 17 | +
|
| 18 | +$mail = new PHPMailer();
|
| 19 | +
|
| 20 | +$body = file_get_contents('contents.html');
|
| 21 | +$body = eregi_replace("[\]",'',$body);
|
| 22 | +
|
| 23 | +$mail->IsSMTP(); // telling the class to use SMTP
|
| 24 | +$mail->Host = "smtp1.site.com;smtp2.site.com";
|
| 25 | +$mail->SMTPAuth = true; // enable SMTP authentication
|
| 26 | +$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent
|
| 27 | +$mail->Host = "mail.yourdomain.com"; // sets the SMTP server
|
| 28 | +$mail->Port = 26; // set the SMTP port for the GMAIL server
|
| 29 | +$mail->Username = "yourname@yourdomain"; // SMTP account username
|
| 30 | +$mail->Password = "yourpassword"; // SMTP account password
|
| 31 | +$mail->SetFrom('list@mydomain.com', 'List manager');
|
| 32 | +$mail->AddReplyTo('list@mydomain.com', 'List manager');
|
| 33 | +
|
| 34 | +$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
|
| 35 | +
|
| 36 | +@MYSQL_CONNECT("localhost","root","password");
|
| 37 | +@mysql_select_db("my_company");
|
| 38 | +$query = "SELECT full_name, email, photo FROM employee WHERE id=$id";
|
| 39 | +$result = @MYSQL_QUERY($query);
|
| 40 | +
|
| 41 | +while ($row = mysql_fetch_array ($result)) {
|
| 42 | + $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
| 43 | + $mail->MsgHTML($body);
|
| 44 | + $mail->AddAddress($row["email"], $row["full_name"]);
|
| 45 | + $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
|
| 46 | +
|
| 47 | + if(!$mail->Send()) {
|
| 48 | + echo "Mailer Error (" . str_replace("@", "@", $row["email"]) . ') ' . $mail->ErrorInfo . '<br />';
|
| 49 | + } else {
|
| 50 | + echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "@", $row["email"]) . ')<br />';
|
| 51 | + }
|
| 52 | + // Clear all addresses and attachments for next loop
|
| 53 | + $mail->ClearAddresses();
|
| 54 | + $mail->ClearAttachments();
|
| 55 | +}
|
| 56 | +?>
|
| 57 | +
|
| 58 | +</body>
|
| 59 | +</html>
|
Property changes on: trunk/extensions/EmailPage/PHPMailer_v5.1/examples/test_db_smtp_basic.php |
___________________________________________________________________ |
Added: svn:executable |
1 | 60 | + * |