D
D
Denis_13342020-03-27 11:31:55
PHP
Denis_1334, 2020-03-27 11:31:55

How to connect PHPMailer correctly?

I looked at the connections on the Internet, but there is an old version, so it does not fit.
Downloaded from here - https://github.com/PHPMailer/PHPMailer
In the \libs folder, the PHPMailer-master
5e7db8916670f691554406.png

index.php library

<?php
use PHPMailer\PHPMailer\PHPMailer;

    $from       = "[email protected]";
    $mail       = new PHPMailer();

    $mail->IsSMTP();
    $mail->IsHTML(true);

    $mail->SMTPAuth   = true;
    $mail->Host       = 'smtp.mail.ru';
    $mail->Port       =  465;
    $mail->Username   = "???";
    $mail->Password   = "???";

    $mail->Subject    = 'Something has been written';

    $mail->addAddress('[email protected]');

    $mail->send();


5e7db98578479422313148.png

??? - of course, I replaced it with real data.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
del993788, 2020-03-28
@del993788

Well, the first article on Google...
https://medium.com/@shpaginkirill/sane-tool...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question