$mail->Body = 'This is just a plain text message body' – contains the mail message body.The file_get_contents() function will load the content from message.html, a local file located in the public_html directory, and include it in the message. $mail->msgHTML(file_get_contents('message.html'), _DIR_) – reads an HTML message body from an external file.$mail->Subject = 'Checking if PHPMailer works' – add the email subject here.'Receiver Name') – insert the recipient’s address here.'Your Name') – informs the recipient which address they should reply to.'Your Name') – this is where you insert the sender’s email address.$mail->Password = 'My$tr0ngPa55w0rd! – enter your email password here.$mail->Username = – specify your email address here.$mail->SMTPAuth = true – activates SMTP authentication.We’ll pick SMTP port 587 as the default mail submission port for all types of SMTP data transmission. $mail->Port = 587 – set the SMTP port here.$mail->Host = '' – this is where the SMTP server address should be specified.$mail->SMTPDebug = 2 – detects if something goes wrong with the SMTP connection.$mail->isSMTP() – tells PHPMailer class to use the custom SMTP configuration defined in the script instead of the local mail server.$mail = new PHPMailer – creates a new PHPMailer object.require './vendor/autoload.php' – includes various libraries that PHPMailer needs.use PHPMailer\PHPMailer\PHPMailer – imports the PHPMailer class to the global namespace.To understand how PHPMailer works, let’s review each script component above. Learn more SSH commands to help manage your server. Wait a moment until the installation process is finished.Run the following command to install Composer:. Execute the following command to navigate to the public_html directory:.Remember that PuTTY will not display the password, so don’t be surprised if it doesn’t appear on the screen. Once a command window appears, type in your SSH username and password and hit Enter.Open PuTTY and enter your SSH information in the Host Name (or IP address) and Port fields.From your hPanel dashboard, go to Advanced → SSH Access and take note of the SSH IP, port, username, and password under the SSH details.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |