<?php /** * Class GOSMTP_Mailer_Mail. * * @since 1.0.0 */ namespace GOSMTP\Mailer; use GOSMTP\Mailer\Loader; class Mail extends Loader{ var $title = 'Default'; var $mailer = 'mail'; /** * Override default mail send function. * @since 1.0.0 */ public function send() { global $phpmailer; $phpmailer->isMail(); 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!', [])); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
loader.php | File | 10.59 KB | 0644 |
|
mail.php | File | 840 B | 0644 |
|
mailgun.php | File | 6.27 KB | 0644 |
|
postmark.php | File | 5.18 KB | 0644 |
|
sendgrid.php | File | 4.71 KB | 0644 |
|
sendinblue.php | File | 4.83 KB | 0644 |
|
sendlayer.php | File | 5.34 KB | 0644 |
|
smtp.php | File | 4 KB | 0644 |
|
smtpcom.php | File | 6.1 KB | 0644 |
|
sparkpost.php | File | 5.64 KB | 0644 |
|