We've changed from gmail to office 365, but the issue: Client does not have permissions to send as this sender 550 when sending email.
Do we have any configuration in office 365 mail service to enable sending email from website/application?
This is my .env configuration:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=mail_username
MAIL_PASSWORD=mail_password
MAIL_ENCRYPTION=tls
You should configure the correct from email address, that matches to your Office 365 Email Address.
You can configure it in config/mail.php from option or these env variables MAIL_FROM_ADDRESS and MAIL_FROM_NAME.
See also: 550 5.7.1 Client does not have permissions to send as this sender (office365)
Related
In my Laravel 8 I use sendgrid for emails with account info in .env file:
MAIL_MAILER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_FROM_ADDRESS=myaccount#gmail.com
MAIL_USERNAME=apikey
MAIL_PASSWORD="XX.XXXXXXXXX_XXXXX.XXXXXXXXXXXXXXXX"
MAIL_ENCRYPTION=tls
and emailing in control like :
Mail::to($new_user)->send(new UserRegistered($subject,
$site_home_url,
$new_user->email,
$new_user->full_name,
$confirm_url,
$support_signature
));
where UserRegistered is app/Mail/UserRegistered.php file
and testing with several my email accounts I found that I recieve emails at all my accounts, except
yahoo.com. Checking Spam folder I see it is empty : https://imgur.com/a/NblVlJG
I wonder why I do not receive emails at yahoo.com? any additive rules of yahoo.com?
Are there any debugging tools on Sendgrid side or Laravel?
I am using laravel I got this error when I send emails
fwrite(): send of 18 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host.
it was working normally
this is my configuration
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=givkom#gmail.com
MAIL_PASSWORD=123456789
MAIL_ENCRYPTION=tls
Mail::to($request->email)->send(new DonorMail());
change .env file like this:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=ENTER_YOUR_EMAIL_ADDRESS(GMAIL)
MAIL_PASSWORD=ENTER_YOUR_GMAIL_PASSWORD
MAIL_ENCRYPTION=ssl
The MAIL_USERNAME and PASSWORD should be replaced with your Gmail Email address and Password respectively.
Since we are using Gmail SMTP, we need to change some security settings on our Google account, to give access to less secured applications.
Configure your Google Account
Login to your Google Email Account and click on Google Account Button.
Once you are on My Account Page then click on Security and scroll down to the bottom and you will find ‘Less secure app access’ settings. Click on the radio button to set it ON.
I have the centos server with laravel setup. I am facing issue while sending email from server. My laravel version is 5.8.29 and PHP version is 7.3.6. I am using SMTP to send email. Guys please do help me out. Here are my code.
It's very strange to say that from my local setup from my system I am able to send email with same SMTP details with current project setup with same code. But some how on production server the emails are not sending. I have cross checked with swift mailer and tested with separate file for only email send and its work. But from actual environment is not work.
.env file
MAIL_DRIVER=smtp
MAIL_HOST=mail.domain.com
MAIL_PORT=587
mail_username=username
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
Email should be send from the environment file
If you want to send an e-mail via Gmail then you need to verify your Gmail account with 2 step verification and generate mail password. for verifying your Gmail account to throw this link enter link description here after verifying your account go to "security->app password" generate mail password. select app "mail" and select device "window computer" copy the generated password paste into your .env file
Your .env file show look like:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=username
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
After saving your.env file, remove project config and cache with the command
php artisan config:cache
php artisan cache:clear
For sending an email via Domain follow this link enter link description here
I am new to Laravel. I have easily implemented Laravel email verification for the registered based on Laravel https://laravel.com/docs/5.8/verification
its working fine for testing purpose in local server. now I want to upload to server. now it's using default Mailtrap to receive an email of all the users.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=****
MAIL_PASSWORD=****
MAIL_ENCRYPTION=tls
//user.php
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable;
My requirement is after registering, the email should send to the registered emailId, not to the mailtrap account. I have researched a lot on this in google but all the solution is only for sending emails to mailtrap or others but instead, I want to send to the users' email ID with the verification link.
I am assuming you have successfully implemented the activation email.
For your application to send email to the registered user email address you need to provide your email server SMTP credentials. For live application, you can not use mail trap credentials. If you use mailtrap credentials you will only get emails to your mail trap account.
If you do not have live smtp server credential, you can create a Gmail account and user Gmail SMTP credentials.
And one more thing, if you are using Gmail, change settings for Less secure app from your google account.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=****
MAIL_PASSWORD=****
MAIL_ENCRYPTION=tls
this is .env configuration you have change to your own mail server. so that laravel will send email using these settings to the registered users.
I tried to click on link forget password and it says email has been sent but I didn't receive email
I am using gmail smpt in db config
I have already tried to change the setting in .env file but still nothing
This is mail config
MAIL_DRIVER=mail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=username#gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
This isn't working it only says email has been sent but I didn't receive mail
I have also allowed in gmail to use Allow less secure apps: ON
so that app can directly send mail
You said you are using smpt driver. but in configuration you have set to mail.
So, you need to set MAIL_DRIVER from mail to smtp as given below:
'MAIL_DRIVER=smtp`.
Which password you are using ? Is that password which you are using to get login to gmail server ?
If yes then go to Myaccount of gmail then go to sign in and security and go to App password and generate password for Mail App and use that password.
May be that works for you. Same is working for me. Also change the following settings in your .env file.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_ENCRYPTION=tls
I changed the value of MAIL_DRIVER from mail to sendmail in the .env file
MAIL_DRIVER=sendmail
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=email#gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
In account setting of gmail allow unsecured app to send mail works for me