0

I try to send email using cpanel email account, but when i send email go to spam.

this is the .env file

MAIL_DRIVER=smtp
MAIL_HOST=mail.***********.com.sa
MAIL_PORT=465
MAIL_USERNAME=basma@**********.com.sa
MAIL_PASSWORD=********
MAIL_ENCRYPTION=ssl
  • Try adding MAIL_FROM_ADDRESS, MAIL_FROM_NAME in your .env file. – Ts8060 Mar 31 '20 at 06:46
  • I used that in mailable class ``` public function build() { $subject = $this->data['name']; return $this->from('s*******99@gmail.com')->subject($subject)->view('admin.dynamic_email_template')->with('data', $this->data); } ``` – Ahmed Mustafa Mar 31 '20 at 13:04

1 Answers1

1
 use mail username of gmail and use proper content , it will not got to spam

MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=*****@gmail.com MAIL_PASSWORD=********* MAIL_ENCRYPTION=ssl

  • yes, thank u and with setup will complete the process https://stackoverflow.com/questions/42558903/expected-response-code-250-but-got-code-535-with-message-535-5-7-8-username – Ahmed Mustafa Mar 31 '20 at 14:29
  • brother! do u know why qr code cannot sent to gmail? i convert it to img but still don't work ! – Ahmed Mustafa Mar 31 '20 at 14:51
  • Hey bro , you have to store qr code image in storage and store that link in database and in mail just fetch that image link from database. It Will WORK ....If not understand please tell, will expalin you again bro. – Nitish Anand Apr 01 '20 at 05:46
  • thank u for your response i solved it without store in database or storage folder – Ahmed Mustafa Apr 01 '20 at 06:04
  • thanks bro did you know the fix of this problem Unable to guess the MIME type as no guessers are available (have you enable the php_fileinfo extension?). this appear when upload my laravel project on cpanel – Ahmed Mustafa Apr 01 '20 at 06:22