Smtp Emails Do Not Send

I have checked and rechecked my email settings in CSCart and I have the correct email address and password and mail server in there. The problem, I believe, is that my mail server uses port 465 and not 25 or 2525 for SMTP which are often defaults.



How is CS-Cart programmed? When you choose SMTP, is it setup as 25 or 2525 or 465? Or does it try all ports when sending email? Is there a file somewhere that I can go into and change the default port?



When I try to send an email from my contact page which is suppose to send to my customer support email or after orders are placed and my admin is support to get notifications and customers too, none of those go out. The thing is, when I do tests like sending a customer a copy of his invoice by clicking the drop down option on the order confirmation page or filling out the contact form, I don’t get an error message like: failed to connect to SMTP.



It’s like it’s sending but the emails aren’t arriving. Is this a port problem if there is no error message or likely a server problem? I can’t find the emails anywhere, not even in trash or spam.



I’m running currently: [color=#000000]CS-Cart [/color]4.1.2



Thank you for any help you can provide. This is really bugging me.

You either need to use a hook to set the port or go into app/Tygh/Mailer.php and change the port there.

Thank you for responding. So, I just accessed that file and this is what I see that could relate to the settings for email:



if ($mailer_settings['mailer_send_method'] == 'smtp') {
self::$_mailer->IsSMTP();
self::$_mailer->SMTPAuth = ($mailer_settings['mailer_smtp_auth'] == 'Y') ? true : false;
self::$_mailer->Host = $mailer_settings['mailer_smtp_host'];
self::$_mailer->Username = $mailer_settings['mailer_smtp_username'];
self::$_mailer->Password = $mailer_settings['mailer_smtp_password'];




Would I put something like the following:



if ($mailer_settings['mailer_send_method'] == 'smtp') {
self::$_mailer->IsSMTP();
self::$_mailer->SMTPAuth = ($mailer_settings[',a'] == 'Y') ? true : false;
self::$_mailer->Host = $mailer_settings['mail.myserver.com];
self::$_mailer->Username = $mailer_settings['email@myserver.com'];
self::$_mailer->Password = $mailer_settings['password-here-1234'];




If so, where does port come into the equation? I don't see the option.

My error. It's not in the Mailer.php class but rather in app/lib/other/phpmailer/class.phpmailer.php at about lie 189.



I'm really suprised that csc hasn't exposed the port number to the mail parameters in the admin panel…

Thank you for writing me back. So I've gone into class.phpmailer.php and edited the following:


```php

/////////////////////////////////////////////////

// PROPERTIES FOR SMTP

/////////////////////////////////////////////////

/**

  • Sets the SMTP hosts. All hosts must be separated by a
  • semicolon. You can also specify a different port
  • for each host by using this format: [hostname:port]
  • (e.g. “smtp1.example.com:25;smtp2.example.com”).
  • Hosts will be tried in order.
  • @var string

    */

    public $Host = 'mail.myserver.com:587';

    /**
  • Sets the default SMTP server port.
  • @var int

    */

    public $Port = 587;

    /**
  • Sets the SMTP HELO of the message (Default is $Hostname).
  • @var string

    */

    public $Helo = '';

    /**
  • Sets connection prefix.
  • Options are “”, “ssl” or “tls”
  • @var string

    */

    public $SMTPSecure = '';

    /**
  • Sets SMTP authentication. Utilizes the Username and Password variables.
  • @var bool

    */

    public $SMTPAuth = false;

    /**
  • Sets SMTP username.
  • @var string

    */

    public $Username = 'email@myserver.com';

    /**
  • Sets SMTP password.
  • @var string

    */

    public $Password = 'password-here-1234';

    /**
  • Sets the SMTP server timeout in seconds.
  • This function will not work with the win32 version.
  • @var int

    */

    public $Timeout = 10;

    /**
  • Sets SMTP class debugging on or off.
  • @var bool

    */

    public $SMTPDebug = false;

    /**
  • Prevents the SMTP connection from being closed after each mail
  • sending. If this is set to true then to close the connection
  • requires an explicit call to SmtpClose().
  • @var bool

    */

    public $SMTPKeepAlive = false;

    /**
  • Provides the ability to have the TO field process individual
  • emails, instead of sending to entire TO addresses
  • @var bool

    */

    public $SingleTo = false;

    /**
  • If SingleTo is true, this provides the array to hold the email addresses
  • @var bool

    */

    public $SingleToArray = array();

    /**
  • Provides the ability to change the line ending
  • @var string

    */

    public $LE = “\n”;

    ```



    I've also changed my settings to “via phpmailer” and cleared my cache. I'm not getting emails when I try to send a message through the contact form on the site but it is not arriving in my Inbox. Very strange.

If you are not getting an error, you will have to work with whomever hosts your smtp to review the maillogs.

I am using "via php mail function" but no email is sent and I always get this error

Fatal error: Cannot make static method PHPMailer::RFCDate() non static in class Tygh\Mailer in /home/onlineam/public_html/app/Tygh/Mailer.php on line 18

Please help me to fix this.

What version are you running? I don't see any reference to RFCDate() in the current Mailer.php file and line 18 is header comments.

In fact, I don't find any reference to RFCDate anywhere in the Tygh directory structure.

What version are you running? I don't see any reference to RFCDate() in the current Mailer.php file and line 18 is header comments.
In fact, I don't find any reference to RFCDate anywhere in the Tygh directory structure.


I'm sorry. I have confused you. Actually my issue is at

http://forum.cs-cart.com/topic/25659-password-recovery-mail/?fromsearch=1

Refer post #4. Please help me to fix this. I'm using 4.0