$92 GRAYBYTE WORDPRESS FILE MANAGER $91

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/var/softaculous/sitepad/editor/site-data/plugins/gosmtp/main/mailer/

HOME
Current File : /var/softaculous/sitepad/editor/site-data/plugins/gosmtp/main/mailer//smtp.php
<?php
/**
 * Class GOSMTP_Mailer_SMTP.
 *
 * @since 1.0.0
 */
 
namespace GOSMTP\Mailer;
 
use GOSMTP\Mailer\Loader;

class SMTP extends Loader{
	
	var $title = 'Other SMTP';
	var $mailer = 'smtp';
	
	/**
	 * Override default mail send function.
	 * @since 1.0.0
	 */
	public function send(){
		global $phpmailer;
		
		$phpmailer->isSMTP();
		
		$encryption = $this->getOption('encryption', $this->mailer);
		
		if ( !empty($encryption) && 'none' !== $encryption) {
			$phpmailer->SMTPSecure = $encryption;
		}

		// Set the other options
		$phpmailer->Host = $this->getOption('smtp_host', $this->mailer);
		$phpmailer->Port = $this->getOption('smtp_port', $this->mailer);

		// If we're using smtp auth, set the username & password
		$smtp_auth = $this->getOption('smtp_auth', $this->mailer);
		if(!empty($smtp_auth) && $smtp_auth == 'Yes'){
			$phpmailer->SMTPAuth = true;
			$phpmailer->Username = $this->getOption('smtp_username', $this->mailer);
			$phpmailer->Password = $this->getOption('smtp_password', $this->mailer);
		}
		
		//PHPMailer 5.2.10 introduced this option. However, this might cause issues if the server is advertising TLS with an invalid certificate.
		$phpmailer->SMTPAutoTLS = false;
		
		$ssl_verification = $this->getOption('disable_ssl_verification', $this->mailer);
		
		if(!empty( $ssl_verification )) {
			// Insecure SSL option enabled
			$phpmailer->SMTPOptions = array(
				'ssl' => array(
					'verify_peer'       => false,
					'verify_peer_name'  => false,
					'allow_self_signed' => true,
				),
			);
		}

		//set reasonable timeout
		$phpmailer->Timeout = 10;
		
		if($phpmailer->preSend()){
			try{
				if($phpmailer->postSend()){
					$response = [
						'status' => true,
						'code' => 200,
						'messageId' => '',
						'message' => 'Mail sent successfully',
					];
					return $this->handle_response($response);
				}
			}catch( \Exception $e ){
				return $this->handle_response(new \WP_Error(400,  $e->getMessage(), []));
			}
		}
		return $this->handle_response(new \WP_Error(400, 'Unable to send mail for some reason!', []));
	}
	
	public function load_field(){
		
		$fields = array(
			'smtp_host' => array(
				'title' => __('SMTP Host', 'gosmtp'),
				'type' => 'text',
				'place_holder' => 'smtp.example.com',
				'desc' => __( 'Your mail server', 'gosmtp' ),
			),
			'encryption' => array(
				'title' => __('Type of Encryption', 'gosmtp'),
				'type' => 'radio',
				'desc' => __( 'For most servers TLS is the recommended option. If your SMTP provider offers both SSL and TLS options, we recommend using TLS.', 'gosmtp' ),
				'list' => array(
					'none' => 'None',
					'ssl' => 'SSL',
					'tls' => 'TLS',	
				),
			),
			'smtp_port' => array(
				'title' => __('SMTP Port', 'gosmtp'),
				'type' => 'text',
				'place_holder' => '465',
				'desc' => __( 'The port to your mail server', 'gosmtp' ),
			),
			'smtp_auth' => array(
				'title' => __('SMTP Authentication', 'gosmtp'),
				'type' => 'radio',
				'desc' => __( 'This options should always be checked Yes', 'gosmtp' ),
				'list' => array(
					'No' => 'No',
					'Yes' => 'Yes',
				),
			),
			'smtp_username' => array(
				'title' => __('SMTP Username', 'gosmtp'),
				'type' => 'text',
				'place_holder' => 'admin',
				'tr_class' => 'smtp-authentication',
				'desc' => __( 'The username to login to your mail server', 'gosmtp'),
			),
			'smtp_password' => array(
				'title' => __('SMTP Password', 'gosmtp'),
				'type' => 'password',
				'place_holder' => 'Password',
				'tr_class' => 'smtp-authentication',
				'desc' => __( 'The SMTP Password to login to your mail server. The saved password is not shown for security reasons. You need enter it every time you update the settings.', 'gosmtp'),
			),
			'disable_ssl_verification' => array(
				'title' => __('Disable SSL Certificate Verification', 'gosmtp'),
				'type' => 'checkbox',
				'desc' => __( 'As of PHP 5.6 you will get a warning/error if the SSL certificate on the server is not properly configured. You can check this option to disable that default behaviour. Please note that PHP 5.6 made this change for a good reason. So you should get your host to fix the SSL configurations instead of bypassing it', 'gosmtp'),
			),
		);
		
		return $fields;
	}
}


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
21 Feb 2026 2.55 AM
root / root
0755
loader.php
12.468 KB
18 Feb 2026 11.32 PM
root / root
0644
mail.php
0.818 KB
18 Feb 2026 11.32 PM
root / root
0644
maileroo.php
5.391 KB
18 Feb 2026 11.32 PM
root / root
0644
mailgun.php
6.325 KB
18 Feb 2026 11.32 PM
root / root
0644
postmark.php
5.307 KB
18 Feb 2026 11.32 PM
root / root
0644
sendgrid.php
5.113 KB
18 Feb 2026 11.32 PM
root / root
0644
sendinblue.php
4.845 KB
18 Feb 2026 11.32 PM
root / root
0644
sendlayer.php
5.359 KB
18 Feb 2026 11.32 PM
root / root
0644
smtp.php
4.155 KB
18 Feb 2026 11.32 PM
root / root
0644
smtpcom.php
6.136 KB
18 Feb 2026 11.32 PM
root / root
0644
sparkpost.php
5.679 KB
18 Feb 2026 11.32 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF