SMTP Configuration

 

What is meant by SMTP Server?

An SMTP Web Server is the short form of Simple Mail Transfer Protocol Server that can be termed as an application that sends and receives emails. One of the important functions of an SMTP Server is to act as a mediator between emails that is the one that is received and sent. An important point to be noted is that its just an application that sends and receives emails.

SMTP Configuration of cPanel, Plesk, and OVI Panel for website hosting account has the same steps. Steps to configure it are mentioned below:


SMTP Configuration for cPanel, Plesk, and OVI Panel

 

SMTP Configuration For POP3



Outgoing mail server (SMTP ): mail.domainname.com
Outgoing server port# (SMTP): 25,587
SSL/TLS: None

SMTP Configuration For IMAP
Outgoing Port#:
Without SSL – One of the following: 25, 26, 587
With SSL – 465

STEP 1: 

Download the SMTP packages,

https://help.hostingraja.in/SMTP-PHPmailer.zip

STEP 2:

unzip SMTP-PHPmailer.zip

STEP 3:

Refer to the demo.php file,

<?php


require("class.phpmailer.php");


$mail = new PHPMailer;

$mail->IsSMTP(); // Set mailer to use SMTP
$mail->Host = "mail.yourdomain.in"; // Specify main and backup server
//$mail->Host = "Give IP Address"; // If the above does not work.
$mail->Port = 25; // Set the SMTP port
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = "This email address is being protected from spambots. You need JavaScript enabled to view it."; // SMTP username
$mail->Password = "Link@123"; // SMTP password
//$mail->SMTPSecure = "ssl"; // Enable encryption, 'ssl' also accepted

$mail->From = This email address is being protected from spambots. You need JavaScript enabled to view it.';
$mail->FromName = 'From name';
$mail->AddAddress(This email address is being protected from spambots. You need JavaScript enabled to view it.'); // Add a recipient

$mail->IsHTML(true); // Set email format to HTML

$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <strong>in bold!</strong>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->Send()) {
print_r($mail);
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}

echo 'Message has been sent';
exit(0);

?>