I have successfully send email from my application using Gmail account.
Now I want to send email using Web-mail account from my application.
After changing inside .env and config/mail.php files,s I can't send mail and got error
local.ERROR: Failed to authenticate on SMTP server with username "info#sencare.com.bd" using 2 possible authenticators
.env file
MAIL_DRIVER=smtp
MAIL_HOST=sencare.com.bd
MAIL_PORT=587
MAIL_USERNAME=info#sencare.com.bd
MAIL_PASSWORD=&&Pass#2018&& //my webmail password, not application specific password like gmail
MAIL_ENCRYPTION=tls
.config/mail.php file
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'sencare.com.bd'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => 'info#sencare.com.bd',
'name' => 'Bacekend System',
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
Related
I'm trying to use the auth forgot password functionality but it's not working. I already turned on the access for less secure apps in gmail.
.env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.io
MAIL_PORT=587
MAIL_USERNAME=myemail
MAIL_PASSWORD=mypass
MAIL_ENCRYPTION=tls
mail.php
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello#example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
This can be caused by the security settings on your Gmail account.
Probably you need to set the allow less secure apps to access your account.
You can read here how to do it: https://support.google.com/accounts/answer/6010255?hl=en
Also as an SMTP server use smtp.gmail.com
at .env file I have this code:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=azure_edhjjjjj67781b06b18228961b#azure.com
MAIL_PASSWORD=hggahsd666
MAIL_ENCRYPTION=tls
and I get this screen:
I also try:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=465
MAIL_USERNAME=azure_edhjjjjj67781b06b18228961b#azure.com
MAIL_PASSWORD=hggahsd666
MAIL_ENCRYPTION=ssl
but dont works again...
I also try to change settings into config/mail.php to be the same as on .env file but dont work and at the end I try command
php artisan cache:clear
Is possible problem cause redirection to secure domain https://asdasd.com/sendEmail ?
keep mail.php like this way
<?php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => 'hello#example.com',
'name' => 'Example',
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
];
Then cross check all your credentials in .env file, If still not work then go to your email account and change app settings to allow less secure apps
There are many post regarding this problem but none of them seems to fix my problem.
I'm trying to send email using gmail account from my local vagrant box.
My mail config:
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => 'myaccount#gmail.com',
'name' => 'Example',
],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
.env file:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myaccount#gmail.com
MAIL_PASSWORD=16digit_gmail_app_password
MAIL_ENCRYPTION=tls
My code:
\Mail::send('email.order',[], function($message) {
$message->to('other_email#email.com', 'John Smith')
$message->subject('Welcome!');
});
In my gmail account I acctivated 2-Step Verification and I created a app password (select app -> mail, select device -> Other/myLocalDomain.
When I try to send email I get Expected response code 250 but got code "", with message ""
I'm probably missing something here but I can't figure what.
I am using laravel 5.2 with mailgun. Tried sending an email to a user in order that the user resets password. I get this error
ClientException in RequestException.php line 107:
Client error: POST https://api.mailgun.net/v3/sandbox7337ad8917084e1883b28134ba711960.mailgun.org/messages.mime resulted in a 400 BAD REQUEST response:
{
"message": "Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authoriz (truncated...)
This is a section of my .env file
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=2525
MAIL_USERNAME=postmaster#sandbox......mailgun.org
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
MAILGUN_DOMAIN=sandbox..........mailgun.org
MAILGUN_SECRET=key-.........
config/services.php file
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
],
config/mail.php file
'driver' => env('MAIL_DRIVER', 'smtp'),
host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 2525),
'from' => ['address' => 'myemail#gmail.com', 'name' => 'myName'],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
Please, help.
This is the sandbox domain. You need to verify your own domain or verify the recipient in order to send an email to others.
Follow the link to add recipients: https://mailgun.com/app/testing/recipients
I am trying to send mail using my gmail account but its not working.
Connection could not be established with host smtp.gmail.com [Connection timed out #110]
.env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=jitendrameena38#gmail.com
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=ssl
and mail.php is -
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => ['address' => 'jitendrameena38#gmail.com', 'name' => "Minmarks"],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
];
and in my controller -
Mail::raw('This is an test e-mail', function ($message) {
$message->to("jitu#gmail.com", "someone");
$message->subject("hi checking");
$message->getSwiftMessage();
});
What is missing in this. Please help.
Thanks.
You should set
MAIL_DRIVER=sendmail
It works for me.