Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHPMailer

$mail->SMTPOptions = array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => true
        )
    );
Comment

phpmailer

$query = $this->con->prepare('SELECT *);
Comment

php mailer

<?php
//Import PHPMailer classes into the global namespace
//These must be at the top of your script, not inside a function
use PHPMailerPHPMailerPHPMailer;
use PHPMailerPHPMailerSMTP;
use PHPMailerPHPMailerException;

//Load Composer's autoloader
require 'vendor/autoload.php';

//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);

try {
    //Server settings
    $mail->SMTPDebug = SMTP::DEBUG_SERVER;                      //Enable verbose debug output
    $mail->isSMTP();                                            //Send using SMTP
    $mail->Host       = 'smtp.example.com';                     //Set the SMTP server to send through
    $mail->SMTPAuth   = true;                                   //Enable SMTP authentication
    $mail->Username   = 'user@example.com';                     //SMTP username
    $mail->Password   = 'secret';                               //SMTP password
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;            //Enable implicit TLS encryption
    $mail->Port       = 465;                                    //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`

    //Recipients
    $mail->setFrom('from@example.com', 'Mailer');
    $mail->addAddress('joe@example.net', 'Joe User');     //Add a recipient
    $mail->addAddress('ellen@example.com');               //Name is optional
    $mail->addReplyTo('info@example.com', 'Information');
    $mail->addCC('cc@example.com');
    $mail->addBCC('bcc@example.com');

    //Attachments
    $mail->addAttachment('/var/tmp/file.tar.gz');         //Add attachments
    $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    //Optional name

    //Content
    $mail->isHTML(true);                                  //Set email format to HTML
    $mail->Subject = 'Here is the subject';
    $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    $mail->send();
    echo 'Message has been sent';
} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
Comment

PREVIOUS NEXT
Code Example
Php :: How to run PHP script every 5 minutes 
Php :: Route [login] not defined.Route [login] not defined. 
Php :: generate report daily weekly monthly php mysql 
Php :: Error : Call to undefined method IlluminateNotificationsChannelsMailChannel::assertSentTo() 
Php :: Uninitialized string offset 
Php :: laravel create model for existing table 
Php :: laravel override eloquent all function 
Php :: laravel return a single dimensional array 
Php :: hasmany relation in laravel 
Php :: php mail() 
Php :: Laravel Unique Multiple Column validation 
Php :: php warning array to string conversion 
Php :: laravel collection pop 
Php :: laravel group concat values showing duplicate 
Php :: Allowed memory size of 33554432 bytes exhausted (tried to allocate 8192 bytes) 
Php :: split date range into weeks php 
Php :: laravel maintenance mode custom class 
Php :: php file hash 
Php :: how to set 1 year date without saturday in while loop php 
Php :: phpmail headers 
Php :: laravel test filter 
Php :: php pass function as callback 
Php :: wordpress run php code in page 
Php :: laravel Pushing To Array Session Values 
Php :: Magento 2 create admin module 
Php :: Laravel factory creating tempory data 
Php :: What was the old name of PHP? 
Php :: php vs python speed 
Php :: displaying variables in blade laravel 
Php :: laravel permissions package 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =