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.
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.
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:
In short, Apache has nothing to do with SMTP.
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";
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