Access localhost [closed]

0

I recently changed my apache port over xampp to port 465, but how do I access my localhost on the net now? I put localhost:465/mail/ and it does not load.

    
asked by anonymous 30.11.2017 / 15:02

2 answers

3
  • Apache is service that uses the HTTP protocol (which is based on TCP)
  • SMTP is a separate service and protocol, which has nothing to do with HTTP and websites
  • IMAP and POP3 are also different services and protocols

Each of these has no relation to the other, and SMTP, IMAP and POP3 have no connection whatsoever with web page development.

It does not make sense to set the Apache port to SMTP, it's the same as waiting for a taxi to take you to the Hawaii , are services for different things.

Apache is to serve web pages, SMTP has to have a program of SMTP server , usually hosted hosting already serve this if you want to use your own domain.

Now if you are thinking about using a hosting that already has SMTP service or is thinking about using Gmail or Outlook.com you should configure the port directly in PHPMailer, in short, the path is this:

  • Your script goes inside the www or public_html folder that belongs to Apache
  • Your script communicates via TCP with SMTP using PHPMailer, that means nothing to do with Apache
  • phpmailer sends the commands for this communication and waits for the response
  • The phpmailer response that came via TCP is saved in a variable
  • You can display this variable via PHP if you wish

In short, Apache has nothing to do with SMTP.

How to solve

  • Server (program) Apache uses port 80 or 8080 (or any other one that does not conflict)
  • SMTP server (program) uses port 465 (if you have any SMTP server programs on your machine)

If SMTP is from an existing server or service, if your email account is locaweb

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'email-ssl.com.br';
$mail->Port = 465;  
$mail->SMTPSecure = 'ssl';
$mail->SMTPAuth = true;
$mail->IsHTML(true);
$mail->Username = '[email protected]';
$mail->Password = 'senhadoemail';

If your email is in Gmail:

  

Gmail needs to release access, see the walkthrough: link

$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls'; //Gmail usa TLS
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "sua senha";

If your email is live:

$mail->Host = 'smtp.live.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tsl'; //Live usa TLS
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "sua senha";
If the email does not use SSL / TLS then you should remove the $Mailer->SMTPSecure (or set as false ) line and add the following line:

$mail->SMTPAutoTLS = false;

Getting something like:

$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
$mail->SMTPAuth = true; //Define para autenticar
$mail->Host = '<seu host para SMTP>';
$mail->Port = <SUA PORTA, geralmente 587>;
$mail->Username = '<Seu usuário de e-mail, geralmente o e-mail completo>';
$mail->Password = "sua senha";
    
30.11.2017 / 16:22
1

Restore your locahost, you probably read wrong about the SMTP port, it is configured within PHP and not on localhost.

A sample line to set up SMTP in php:

$mail->Port = 465;

If you have more questions follow these tutorials:

Simple Email link

Email With SMTP: link

Important :

Some email providers such as gmail, by default block connections from less secure applications and for the recipient to receive the email you have to allow the connection in the gmail sender, in the case of gmail follow this tutorial: link

    
30.11.2017 / 16:09