D
D
DEnisLEB2018-06-23 17:35:57
PHP
DEnisLEB, 2018-06-23 17:35:57

How to configure smtp?

<?php
  function Send_Mail($to,$subject,$body)
  {
  require 'class.phpmailer.php';
  $from       = "[email protected]";
  $mail       = new PHPMailer();
  $mail->IsSMTP(true);           
  $mail->IsHTML(true);
  $mail->SMTPAuth   = true;                 
  $mail->Host       = "tls://smtp.yourwebsite.com";
  $mail->Port       =  465;                    
  $mail->Username   = "SMTP_Username";  
  $mail->Password   = "SMTP_Password";  
  $mail->SetFrom($from, 'From Name');
  $mail->AddReplyTo($from,'From Name');
  $mail->Subject    = $subject;
  $mail->MsgHTML($body);
  $address = $to;
  $mail->AddAddress($address, $to);
  $mail->Send(); 
  }
  ?>

to send mail from local server

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
John Doe, 2018-06-24
@DEnisLEB

Install some mail service on your local server, Postfix for example.
https://www.digitalocean.com/community/tutorials/h...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question