PluginProbe
SureMail – SMTP and Email Logs Plugin with Amazon SES, Postmark, and Other Providers / 1.7.2
SureMail – SMTP and Email Logs Plugin with Amazon SES, Postmark, and Other Providers v1.7.2
2.0.2 2.0.1 2.0.0 1.9.5 trunk 0.0.4 0.0.5 0.0.6 1.0.0 1.0.1 1.1.0 1.2.0 1.3.0 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 All 31 releases
suremails / suremails.php

suremails.php in SureMail – SMTP and Email Logs Plugin with Amazon SES, Postmark, and Other Providers 1.7.2, at suremails.php

71 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: SureMail
4 * Plugin URI: https://suremails.com
5 * Description: WordPress emails often go missing or land in spam because web hosts aren’t built for reliable delivery. SureMail fixes this by connecting to trusted SMTP services, so your emails reach inboxes—no more lost messages or frustrated customers.
6 * Author: SureMail
7 * Author URI: https://suremails.com/
8 * Version: 1.7.2
9 * License: GPLv2 or later
10 * Text Domain: suremails
11 * Requires at least: 5.4
12 * Requires PHP: 7.4
13 *
14 * @package suremails
15 */
16
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit; // Exit if accessed directly.
19 }
20
21 define( 'SUREMAILS_FILE', __FILE__ );
22 define( 'SUREMAILS_BASE', plugin_basename( SUREMAILS_FILE ) );
23 define( 'SUREMAILS_DIR', plugin_dir_path( SUREMAILS_FILE ) );
24 define( 'SUREMAILS_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
25 define( 'SUREMAILS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
26 define( 'SUREMAILS_VERSION', '1.7.2' );
27 define( 'SUREMAILS', 'suremail' );
28 define( 'SUREMAILS_CONNECTIONS', 'suremails_connections' );
29
30 require_once SUREMAILS_DIR . 'loader.php'; // Include the Loader file.
31 require_once SUREMAILS_DIR . 'inc/emails/handler/mail-handler.php';
32
33 // Ensure protection files are generated on admin init.
34 add_action( 'admin_init', 'suremails_ensure_protection_files' );
35
36 /**
37 * Generate protection files for uploads directory if not already done.
38 *
39 * This is added temporary. Later on this will be moved to save_file method only.
40 *
41 * @since 1.7.2
42 * @return void
43 */
44 function suremails_ensure_protection_files() {
45 $protection_files_generated = get_option( 'suremails_protection_files_generated', false );
46
47 if ( ! $protection_files_generated ) {
48 require_once SUREMAILS_DIR . 'inc/emails/handler/uploads.php';
49 \SureMails\Inc\Emails\Handler\Uploads::generate_protection_files();
50 update_option( 'suremails_protection_files_generated', true, false );
51 }
52 }
53
54 // Define wp_mail if it does not exist.
55 if ( ! function_exists( 'wp_mail' ) ) {
56 /**
57 * Override the wp_mail function to use the SureMails MailHandler.
58 *
59 * @param string|array $to Recipient email address(es).
60 * @param string $subject Email subject.
61 * @param string $message Email message.
62 * @param string|array $headers Optional. Additional headers.
63 * @param array $attachments Optional. Attachments.
64 * @return bool|null Whether the email was sent successfully.
65 */
66 function wp_mail( $to, $subject, $message, $headers = '', $attachments = [] ) {
67 $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
68 return SureMails\Inc\Emails\Handler\MailHandler::handle_mail( $atts );
69 }
70 }
71