i'm using xampp and want to send email with laravel 4.2 mail driver on local machine. But nothings happen. somebody can help?
return array(
'driver' => 'mail',
'host' => 'localhost',
'port' => 25,
'from' => array('address' => 'foo#bar.com', 'name' => 'foo'),
'encryption' => 'tls',
'username' => '',
'password' => '',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
);
Related
I am using Laravel 7 and I want to send an email using the Sendemail driver via Laravel Mail facade. It worked when I used the PHP mail function but I want to use the Laravel Mail facade instead.
My .env file email configuration:
MAIL_DRIVER=sendmail
MAIL_SENDMAIL='/usr/sbin/sendmail -t -i'
My default mail setup in config/mail.php:
'default' => env('MAIL_MAILER', 'sendmail'),
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
],
'ses' => [
'transport' => 'ses',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
],
I have created Mail class as explained in the docs. What is the right configuration to make it work?
First, change the default MAIL_MAILER to use Sendmail.
MAIL_MAILER=sendmail
Then in config/mail.php, update the Sendmail line.
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL', '/usr/sbin/sendmail -bs')
],
Finally, if you need to change the MAIL_SENDMAIL value then add this line to your .env.
MAIL_SENDMAIL='/usr/sbin/sendmail -t -i'
I'm using Gourmet/Email and unable to send mail on Gadaddy from zoho.com hosted account, although everything was working well locally. My transport config is as follow :
'default' => [
'transport' => 'default',
'host' => 'ssl://smtp.zoho.com',
'port' => 465,
'username' => 'address',
'password' => 'pass',
'emailFormat' => 'both',
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
'className' => 'Smtp'
],
I'm getting such a response :
Connection refused
Cake\Network\Exception\SocketException
Can somebody help me fix this ?
I've changed Smtp into Mail for className as found here :
'default' => [
'transport' => 'default',
'host' => 'ssl://smtp.zoho.com',
'port' => 465,
'username' => 'address',
'password' => 'pass',
'emailFormat' => 'both',
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
'className' => 'Mail'
],
And it's fixed.
i install guzzle for sending mail with mailgun, i create mailgun account
this is my mail.php
'driver' => 'mailgun',
'host' => 'smtp.mailgun.org',
'port' => 587,
'from' => array('address' =>'my#gmail.com','name'=>'My Name'),
'encryption' => 'tls',
'username' => null,
'password' => null,
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
and my services.php
'mailgun' => [
'domain' => 'sandboxexxxxxxxxxxxxxxxxxxxxx.mailgun.org',
'secret' => 'key-xxxxxxxxxxxxxxxxxxxxxxx',
],
but i get error, i have setting it right, but what is the problem?
ClientException in Middleware.php line 69:
Client error: 401
I'm facing some problems configuring my app to send Mails from my smtp server, which is located in one remote hosting with 1and1.
I don't know if I'm missing something:
I've changed my app.php to the values given by my hosting provider:
'EmailTransport' => [
'default' => [
'className' => 'Mail',
'host' => 'smtp.1and1.com',
'port' =>'587' ,
'timeout' => 30,
'username' => 'me#dns.com',
'password' => '******',
'client' => null,
'tls' => null,
],
],
'Email' => [
'default' => [
'transport' => 'default',
'from' => '#localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
],
],
Here you can see the instructions given by my hosting provider to connect to their smtp server.
I don't get any result.
Does anybody have an Idea what may I be missing?
I got it working setting classname as 'Mail' and the rest of the parameters as default. Please, do as follows:
'EmailTransport' => [
'default' => [
'className' => 'Mail',
// The following keys are used in SMTP transports
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
'username' => 'user',
'password' => 'secret',
'client' => null,
],
],
In my case only was problem in className.
For using gmail or office365 server it should be so:
'EmailTransport' => [
'default' => [
'className' => 'Mail',
// The following keys are used in SMTP transports
'host' => 'smtp.office365.com',
'port' => 587,
'timeout' => 30,
'username' => 'my#email.com',
'password' => 'myPassword',
'client' => null,
'tls' => true,
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
],
],
Please do as following:
//Adding Smtp information for sending mail through smtp instead of php mail function on local server / live server
'EmailTransport' => [
'default' => [
'className' => 'Smtp',
'host' => 'smtp.1and1.com',
'port' =>'587' ,
'timeout' => 30,
'username' => 'me#dns.com',
'password' => '******',
'client' => null,
'tls' => null,
],
],
You can also enable tls to 'tls' => true if required.
Hi I just uploaded a site and am getting this error with the mail service.
Connection could not be established with host smtp.gmail.com [Connection refused #111]
This are my settings in my mail.php file.
return array(
'driver' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 587,
'from' => array('address' => 'info#thesite.com', 'name' => 'Company Name'),
'encryption' => 'tls',
'username' => '*******',
'password' => '********',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
);
This works perfectly locally on my system but when i upload it live, it gives me errors, please help am at the verge of delivering a project, thanks!
I also faced same problem. As for me I had changed my SMPT configuring to port 25 (with SSL) and it's was fine.
I got my solution from google, you can see at here.
Try googlemail server with ssl encryption
return array(
'driver' => 'smtp',
'host' => 'smtp.googlemail.com',
'port' => 465,
'from' => array('address' => 'info#thesite.com', 'name' => 'Company Name'),
'encryption' => 'ssl',
'username' => '*******',
'password' => '********',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
);
Found the answer to the problem, was from my web host service providers, i use shared host so i had to call them to configure my account with them to be able to send out email, hope this helps anyone who has such problems like me in the future and this is a proper smtp configuration for gmail.
return array(
'driver' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => 465,
'from' => array('address' => 'info#thesite.com', 'name' => 'Company Name'),
'encryption' => 'ssl',
'username' => '*******',
'password' => '********',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
);
Try changing these.
'driver' => 'mail',
'port' => 587,
'encryption' => 'ssl',
This configuration works for me in GoDaddy server.
be sure you google authentication settings are enabled:
https://www.google.com/settings/security/lesssecureapps
change driver smtp to sendmail.it worked for me
MAIL_DRIVER=sendmail