Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 30031

emails not delivered to office365 mail client

$
0
0

I want to send some emails from my laravel application. Emails are sent to Gmail, Yahoo, and some personal email accounts but no emails sent to the office 365 email accounts. In the other services, emails received on the inbox folder.
I tried some other SMTP servers (Google and my hosting SMTP), but no emails will be sent from the Laravel application.
This is my .env file:

MAIL_DRIVER=smtp
MAIL_HOST=cpanel2.mylittledatacenter.com
MAIL_PORT=465
MAIL_USERNAME=info@schoolearn.ir
MAIL_PASSWORD=*****
MAIL_ENCRYPTION=ssl

and this is my sending email class:

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class confirmationEmail extends Mailable implements ShouldQueue
{
    use Queueable, SerializesModels;
    private $userName = null;
    private $link = null;
    private $isConfirmed = null;


    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($username,$link,$isConfirmed)
    {
        //
        $this->userName = $username;
        $this->link = $link;
        $this->isConfirmed = $isConfirmed;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        info("ConfirmationEmail: link: $this->link|isConfirmed:$this->isConfirmed");
        return $this->from('info@test.com','test name')->subject("test title")->view('email_templates.Confirmation')->with(['name'=>$this->userName,'link'=>$this->link, 'isConfirmed'=>$this->isConfirmed]);
    }
}

I think that it can be solve by adding some heading to the email. But i have no idea that what should I do.


Viewing all articles
Browse latest Browse all 30031

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>