Changeset 2352126
- Timestamp:
- 08/04/2020 04:53:08 AM (5 years ago)
- Location:
- search-my-theme
- Files:
- 13 added
- 3 edited
- tags/3.2.1 (added)
- tags/3.2.1/images (added)
- tags/3.2.1/images/edit.png (added)
- tags/3.2.1/images/facebook.jpg (added)
- tags/3.2.1/images/progress.gif (added)
- tags/3.2.1/images/rate-me.png (added)
- tags/3.2.1/images/resortable.jpg (added)
- tags/3.2.1/images/trash.png (added)
- tags/3.2.1/images/twitter.jpg (added)
- tags/3.2.1/lib (added)
- tags/3.2.1/lib/tom-m8te.php (added)
- tags/3.2.1/readme.txt (added)
- tags/3.2.1/search-my-theme.php (added)
- trunk/lib/tom-m8te.php (modified) (1 diff)
- trunk/readme.txt (modified) (3 diffs)
- trunk/search-my-theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
search-my-theme/trunk/lib/tom-m8te.php
r1328677 r2352126 228 228 } 229 229 } 230 }231 }232 233 234 // Allows you to send an email.235 function send_email($is_html, $to_emails, $to_cc_emails, $to_bcc_emails, $from_email, $from_name, $subject, $body, $alt_body = "", $attachments = array(), $smtp_auth = false, $smtp_mail_host = "", $smtp_mail_port = "", $smtp_mail_username = "", $smtp_mail_password = "", $secure_array = array()) {236 237 $mail = new PHPMailer();238 // defaults to using php "mail()"239 $body = preg_replace("/[\"]/","",$body);240 if (!is_array($to_emails)) {241 $to_emails = explode(",", $to_emails);242 }243 foreach ($to_emails as $key => $value) {244 if (is_integer($key)) {245 $mail->AddAddress(str_replace(" ", "",$value), "");246 } else {247 $mail->AddAddress(str_replace(" ", "",$key), $value);248 }249 }250 251 if (!is_array($to_cc_emails)) {252 $to_cc_emails = explode(",", $to_cc_emails);253 }254 foreach ($to_cc_emails as $key => $value) {255 if (is_integer($key)) {256 $mail->AddCC(str_replace(" ", "",$value), "");257 } else {258 $mail->AddCC(str_replace(" ", "",$key), $value);259 }260 }261 262 if (!is_array($to_bcc_emails)) {263 $to_bcc_emails = explode(",", $to_bcc_emails);264 }265 foreach ($to_bcc_emails as $key => $value) {266 if (is_integer($key)) {267 $mail->AddBCC(str_replace(" ", "",$value), "");268 } else {269 $mail->AddBCC(str_replace(" ", "",$key), $value);270 }271 }272 273 $mail->SetFrom($from_email, $from_name);274 $mail->Subject = $subject;275 276 if ($is_html) {277 $body = preg_replace("/<script(.+)*<\/script>/", "", $body);278 } else {279 $body = esc_html($body);280 }281 282 $alt_body = esc_html($alt_body);283 284 $body = str_replace("'", "'", $body);285 $body = str_replace(""", '"', $body);286 $body = str_replace("&", '&', $body);287 $body = str_replace("&", '&', $body);288 $alt_body = str_replace("'", "'", $alt_body);289 $alt_body = str_replace(""", '"', $alt_body);290 $alt_body = str_replace("&", '&', $alt_body);291 $alt_body = str_replace("&", '&', $alt_body);292 293 if ($is_html) {294 $mail->MsgHTML($body);295 } else {296 $mail->Body = $body;297 }298 299 if ($alt_body != "") {300 $mail->AltBody = $alt_body;301 }302 303 foreach ($attachments as $attachment_url) {304 $mail->AddAttachment($attachment_url); // attachment305 }306 307 if ($smtp_auth) {308 $mail->IsSMTP(); // telling the class to use SMTP309 $mail->SMTPAuth = true;310 if ($smtp_mail_host != "") {311 $mail->Host = $smtp_mail_host;312 }313 if ($smtp_mail_port != "") {314 $mail->Port = $smtp_mail_port;315 }316 if ($smtp_mail_username != "") {317 $mail->Username = $smtp_mail_username;318 }319 if ($smtp_mail_password != "") {320 $mail->Password = $smtp_mail_password;321 }322 323 foreach ($secure_array as $secure) {324 if ($secure == "tls") {325 $mail->SMTPSecure = 'tls';326 } else if ($secure == "ssl") {327 $mail->SMTPSecure = 'ssl';328 }329 }330 331 }332 333 if(!$mail->Send()) {334 return "<div class='error'>Mailer Error: ".$mail->ErrorInfo."</div>";335 } else {336 return "<div class='success'>Message sent!</div>";337 230 } 338 231 } search-my-theme/trunk/readme.txt
r2283838 r2352126 5 5 Requires at least: 3.3 6 6 Tested up to: 5.5 7 Stable tag: 3.2 7 Stable tag: 3.2.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html โฆ โฆ 31 31 == Changelog == 32 32 33 = 3.2.1 = 34 35 * Removed redundant email library. 36 33 37 = 3.2 = 34 38 โฆ โฆ 53 57 == Upgrade notice == 54 58 59 = 3.2.1 = 60 61 * Removed redundant email library. 62 55 63 = 3.2 = 56 64 search-my-theme/trunk/search-my-theme.php
r2283838 r2352126 17 17 4) Activate the plugin. 18 18 19 Version: 3.2 19 Version: 3.2.1 20 20 Author: TheOnlineHero - Tom Skroza 21 21 License: GPL2
Note: See TracChangeset for help on using the changeset viewer.