PHP Classes

not localhost => other smtp server

Recommend this page to a friend!

      Verify e-mail  >  All threads  >  not localhost => other smtp server  >  (Un) Subscribe thread alerts  
Subject:not localhost => other smtp server
Summary:Is it possible to use other smtp server port 587
Messages:6
Author:Niek van Baalen
Date:2017-09-18 09:59:23
 

  1. not localhost => other smtp server   Reply   Report abuse  
Picture of Niek van Baalen Niek van Baalen - 2017-09-18 09:59:23
Is it possible to use other smtp server port 587 instead of $from = 'root@localhost'

What has to change?

Niek

  2. Re: not localhost => other smtp server   Reply   Report abuse  
Picture of Konstantin Granin Konstantin Granin - 2017-09-18 11:17:10 - In reply to message 1 from Niek van Baalen
if youre want emulate mail clients communication to a mail server use port 587

in file class.verifyEmail.php edit property:
protected $port = 25;

or add method

public function setPort($port = 25) {
$this->port = $port;
}


The correct work, I can not promise
Class emulate SMTP communication between mail servers.
SMTP communication between mail servers uses TCP port 25.

"$from" is the sender's email.
for change property $from use method setEmailFrom
Set real address so that the server does not accept you as spambot

  3. Re: not localhost => other smtp server   Reply   Report abuse  
Picture of Niek van Baalen Niek van Baalen - 2017-09-18 11:42:49 - In reply to message 2 from Konstantin Granin
Ok but what I am wondering about is how to use another SMTP server instead of the localhost that is now used by your script?

  4. Re: not localhost => other smtp server   Reply   Report abuse  
Picture of Konstantin Granin Konstantin Granin - 2017-09-18 11:58:31 - In reply to message 3 from Niek van Baalen
You want to make a diagram
verifyEmail.php <= SMTP:587 => Server <= SMTP => Server

omnisecu.com/tcpip/smtp-simple-mail ...

The idea should work, but I did not check it.
Try testing

  5. Re: not localhost => other smtp server   Reply   Report abuse  
Picture of Niek van Baalen Niek van Baalen - 2017-09-18 12:27:11 - In reply to message 4 from Konstantin Granin
No I want to use another SMTP server instead of localhost
In your script protected
$from = 'root@localhost';
I would like to use

Outgoing Mail (SMTP) Server: smtp.gmail.com
Use Authentication: Yes
Use Secure Connection: Yes (TLS or SSL depending on your mail client/website SMTP plugin)
Username: your Gmail account (e.g. [email protected])
Password: your Gmail password
Port: 465 (SSL required) or 587 (TLS required)

  6. Re: not localhost => other smtp server   Reply   Report abuse  
Picture of Konstantin Granin Konstantin Granin - 2017-09-18 12:38:10 - In reply to message 5 from Niek van Baalen
it is emulate mail clients communication to a mail server.
It will not work.