PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.2.8
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.2.8
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / email / gateways / class-emailer-wpmail.php

class-emailer-wpmail.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.2.8, at includes/email/gateways/class-emailer-wpmail.php

41 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * WP Mail
5 */
6 class WeForms_Emailer_WPMail implements WeForms_Mailer_Contract {
7
8 /**
9 * Send email via wp_mail
10 *
11 * @param string $to Email addresses to send message
12 * @param string $subject Email subject
13 * @param string $body Message contents
14 * @param array $headers Optional. Files to attach.
15 *
16 * @return bool
17 */
18 public function send( $to, $subject, $body, $headers ) {
19 $_headers = array();
20
21 if ( isset( $headers['from'] ) ) {
22 $_headers[] = sprintf( 'From: %s <%s>', $headers['from']['name'], $headers['from']['email'] );
23 }
24
25 if ( isset( $headers['cc'] ) ) {
26 $_headers[] = sprintf( 'CC: %s', $headers['cc'] );
27 }
28
29 if ( isset( $headers['bcc'] ) ) {
30 $_headers[] = sprintf( 'BCC: %s', $headers['bcc'] );
31 }
32
33 if ( isset( $headers['replyto'] ) ) {
34 $_headers[] = sprintf( 'Reply-To: %s', $headers['replyto'] );
35 }
36
37 $_headers[] = 'Content-Type: text/html; charset=UTF-8';
38
39 return wp_mail( $to, $subject, $body, $_headers );
40 }
41 }