Search
 
SCRIPT & CODE EXAMPLE
 

PHP

phpmailer with laravel

<?php
namespace AppHttpControllers;

use PHPMailerPHPMailer;

class testPHPMailer extends Controller
{
    public function index()
    {
        $text             = 'Hello Mail';
        $mail             = new PHPMailerPHPMailer(); // create a n
        $mail->SMTPDebug  = 1; // debugging: 1 = errors and messages, 2 = messages only
        $mail->SMTPAuth   = true; // authentication enabled
        $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
        $mail->Host       = "smtp.gmail.com";
        $mail->Port       = 465; // or 587
        $mail->IsHTML(true);
        $mail->Username = "testmail@gmail.com";
        $mail->Password = "testpass";
        $mail->SetFrom("testmail@gmail.com", 'Sender Name');
        $mail->Subject = "Test Subject";
        $mail->Body    = $text;
        $mail->AddAddress("testreciver@gmail.com", "Receiver Name");
        if ($mail->Send()) {
            return 'Email Sended Successfully';
        } else {
            return 'Failed to Send Email';
        }
    }
}
Comment

phpmailer with laravel

composer require phpmailer/phpmailer
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress escape for html 
Php :: wordpress disable theme editor 
Php :: show php info 
Php :: redirect php 
Php :: php array_sum 
Php :: redirect back in laravel livewire 
Php :: how can we use two php version in mac os 
Php :: check if value exists in object php 
Php :: php sleep milliseconds 
Php :: where date laravel 
Php :: include a website in php file 
Php :: remove autoupdate wordpress 
Php :: include a page from another directory php 
Php :: php get number from string 
Php :: placa de carro mercossul brasil 
Php :: combine array except common ones php 
Php :: joomla redirect 
Php :: qual é a melhor linguagem de 
Php :: laravel gigapay create employee 
Php :: carbon add days 
Php :: php explode 
Php :: webuzo set upload limit 
Php :: string to int laravel 
Php :: php get random element from array 
Php :: memory limit wordpress 
Php :: laravel 5.4 forelse 
Php :: laravel create migration view 
Php :: laravel get query in normal sql without bindings 
Php :: laravel subdays 
Php :: forever loop php 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =