Welcome Guest, Not a member yet? Register   Sign In
SMTP fails on localhost
#6

here my code 

PHP Code:
<?php

namespace Config;

use 
CodeIgniter\Config\BaseConfig;

class 
Email extends BaseConfig
{
    
/**
     * @var string
     */
    
public $fromEmail;

    
/**
     * @var string
     */
    
public $fromName;

    
/**
     * @var string
     */
    
public $recipients;

    
/**
     * The "user agent"
     *
     * @var string
     */
    
public $userAgent 'CodeIgniter';

    
/**
     * The mail sending protocol: mail, sendmail, smtp
     *
     * @var string
     */
    
public $protocol 'smtp';

    
/**
     * The server path to Sendmail.
     *
     * @var string
     */
    
public $mailPath '/usr/sbin/sendmail';

    
/**
     * SMTP Server Address
     *
     * @var string
     */
    
public $SMTPHost='yourhost.com';

    
/**
     * SMTP Username
     *
     * @var string
     */
    
public $SMTPUser='[email protected]';

    
/**
     * SMTP Password
     *
     * @var string
     */
    
public $SMTPPass='yourpass';

    
/**
     * SMTP Port
     *
     * @var integer
     */
    
public $SMTPPort 465;

    
/**
     * SMTP Timeout (in seconds)
     *
     * @var integer
     */
    
public $SMTPTimeout 5;

    
/**
     * Enable persistent SMTP connections
     *
     * @var boolean
     */
    
public $SMTPKeepAlive false;

    
/**
     * SMTP Encryption. Either tls or ssl
     *
     * @var string
     */
    
public $SMTPCrypto 'tls';

    
/**
     * Enable word-wrap
     *
     * @var boolean
     */
    
public $wordWrap true;

    
/**
     * Character count to wrap at
     *
     * @var integer
     */
    
public $wrapChars 76;

    
/**
     * Type of mail, either 'text' or 'html'
     *
     * @var string
     */
    
public $mailType 'text';

    
/**
     * Character set (utf-8, iso-8859-1, etc.)
     *
     * @var string
     */
    
public $charset 'UTF-8';

    
/**
     * Whether to validate the email address
     *
     * @var boolean
     */
    
public $validate false;

    
/**
     * Email Priority. 1 = highest. 5 = lowest. 3 = normal
     *
     * @var integer
     */
    
public $priority 3;

    
/**
     * Newline character. (Use “\r\n” to comply with RFC 822)
     *
     * @var string
     */
    
public $CRLF "\r\n";

    
/**
     * Newline character. (Use “\r\n” to comply with RFC 822)
     *
     * @var string
     */
    
public $newline "\r\n";

    
/**
     * Enable BCC Batch Mode.
     *
     * @var boolean
     */
    
public $BCCBatchMode false;

    
/**
     * Number of emails in each BCC batch
     *
     * @var integer
     */
    
public $BCCBatchSize 200;

    
/**
     * Enable notify message from server
     *
     * @var boolean
     */
    
public $DSN false;








PHP Code:
            $email =\Codeigniter\Config\Services::email();
            $emailConfig = new \Config\Email();


            $email->setFrom($emailConfig->fromEmail$emailConfig->fromName);
            $email->setTo($contacting['email']);
            $email->setSubjectlang('Common.apiEvent.emailReply').' '$contacting['title'] );
            $email->setMessage($this->request->getJSON()->reply);
            $result $email->send();

     //       print_r(  $email->printDebugger()); 
Enlightenment  Is  Freedom
Reply


Messages In This Thread
SMTP fails on localhost - by akinuri - 05-23-2021, 05:28 AM
RE: SMTP fails on localhost - by akinuri - 05-23-2021, 07:56 AM
RE: SMTP fails on localhost - by ogomez - 05-23-2021, 11:26 AM
RE: SMTP fails on localhost - by InsiteFX - 05-23-2021, 11:34 AM
RE: SMTP fails on localhost - by paliz - 05-23-2021, 07:17 PM
RE: SMTP fails on localhost - by InsiteFX - 05-23-2021, 08:35 PM
RE: SMTP fails on localhost - by paliz - 05-23-2021, 09:20 PM
RE: SMTP fails on localhost - by InsiteFX - 05-24-2021, 04:03 AM
RE: SMTP fails on localhost - by akinuri - 05-25-2021, 11:34 AM
RE: SMTP fails on localhost - by chaos - 11-23-2022, 10:50 AM
RE: SMTP fails on localhost - by motoroller - 11-23-2022, 02:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB