Skip to main content

Install and use PhpMailer?

Comments

5 comments

  • kdean
    Documentation and other info is found scrolled down at the following link. GitHub - PHPMailer/PHPMailer: The classic email sending library for PHP
    0
  • rpvw
    Search for phpmailer in YouTube - you will find a number of useful video tutorials.
    0
  • linux4me2
    The big decision is where to install PHPMailer. If you have a number of accounts on our server that you want to give access to PHPMailer, rather than install it for each account, you can install one instance of PHPMailer in /opt/cpanel/ea-php70/root/usr/share/pear/PHPMailer, or another include path for the primary version of PHP you're running. That way, you can use Composer to keep the single installation of PHPMailer up-to-date, and since it's in the include path, any site that's using that version of PHP can use it. If you want to offer it for more than one version of PHP, you can add a symlink in the /root/usr/share/pear/ folder corresponding to the version of PHP that points to the actual PHPMailer installation. That way, you only have to maintain one instance of PHPMailer. Using Composer has been the easiest method of maintaining PHPMailer, though the link at Github will describe both the Composer and non-Composer installs.
    0
  • cPanelMichael
    Hello, The previous posts should help. Let us know if you have additional questions. Thank you.
    0
  • Ranush
    use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'PHPMailer/PHPMailer/src/Exception.php'; require 'PHPMailer/PHPMailer/src/PHPMailer.php'; require 'PHPMailer/PHPMailer/src/SMTP.php'; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPDebug = 2; $mail->Host = 'Outgoing Server ex: sothing.somthing.com does not required mail word before'; //$mail->Debugoutput = 'html'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = 'your email ex: something.something.com'; $mail->Password = 'your password of before mentioned email'; $mail->setFrom('before mentioned email', "something"); $mail->addAddress('receive address', "something"); $mail->Subject = 'something'; $mail->msgHTML('something text'); //$mail->msgHTML(file_get_contents('contents.html'), __DIR__); //Read an HTML message body from an external file, convert referenced images to embedded, $mail->AltBody = 'HTML messaging not supported'; // $mail->addAttachment('images/phpmailer_mini.png'); //Attach an image file // echo "err"; if(!$mail->send()){ //echo "Mailer Error: " . $mail->ErrorInfo; echo "Ok email send"; }else{ echo "err"; } //$mail->Host = 'please add your cpanel of email server';
    0

Please sign in to leave a comment.