After I changed my shared host, I have problem with Forgot password link. In my app all sections need to send email work fine but when I pressed forgot password button I got success alert that link sent to your email but when I checked my mails it was empty!!(app doesn't send link)
I checked all my logs in app and host there weren't any error.
I use default Laravel settings.(Laravel 7).
In .env file add new variable called MAIL_FROM_ADDRESS=your_smtp_from_mail_id . you have to set MAIL_FROM_ADDRESS to valid SMTP from_mail email id. sometimes in the .env file, this variable doesn't exist. if it is not set manually; when sending mail it is picking up a default mail id which is hello#example.com. please have look here config/mail.php
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello#example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
i think this should work !
This worked for me.
Related
I want to create a collaborative text editor app and came across this tutorial. I accessed the repository on github and followed all the steps from the README file to install and use the app. Also, in the tutorial, after I created the app on Pusher, I checked the "Enable client events" option on the App Settings tab.
However, when I type anything in the note textfield, the two following errors appear on the browser's console:
1)
Pusher : Error : {"type":"WebSocketError","error":"type":"PusherError","data":
{"code":null,"message":"Invalid key in subscription auth data:
'xxxxxxxxxxxx'"}}}
2)
Pusher : Error : {"type":"WebSocketError","error":
{"type":"PusherError","data":{"code":null,"message":"Cannot broadcast
client event (connection not subscribed to channel presence-note.note-
test-for-pusherqjvQbgt4s9)"}}}
The second error happens when I type something and the first one right when I load the page. I presume the second one is happening because of the first one.
This is my broadcasting.php file:
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
//
'cluster' => 'us2',
'encrypted' => true
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
The values set in the env file I get from the app keys on my Pusher account. I've already double checked if the values are set correctly and it seems to be fine.
I appreciate any help. Thanks in advance
The first client side error suggests your auth endpoint isn't sending a valid response to the client, and Pusher can't validate it. Have you specified exactly the same credentials in your server as in your client? Especially the specification of the cluster.
The second client side error you're getting suggests that your client hasn't actually subscribed to the channel, which would mean that client events wouldn't work.
Double check your client side code to make sure it is actually subscribing to the channel in question. Also, double check the app settings in your Pusher dashboard to ensure client events are enabled.
Perhaps it would be helpful to enable logging on your client side Pusher object. See https://github.com/pusher/pusher-js#global-configuration
We've had the same issue and solved it for Laravel + Vue.
The problem was that the front-end developer is using another Pusher account for local development and he is sending compiled front-end files to git repo.
So, when I get the compiled js files, Echo is created with different credentials than mine because in my .env file there are my Pusher channel credentials.
Solution: npm run dev on my machine. (So that it compiles the js files and Echo will be created with my .env Pusher credentials)
P.S. This solution affirms answer of #kn100
Following steps work for me
Check your app keys at server and client side
run php artisan config:cache
run ``php artisan optimize:clear`
run composer dump-autoload
Restart your IDE
Test your app
Just curious if anyone else is facing this issue with Laravel Spark where the notifications are intermittently stuck in loading and if there's a simple fix for it?
Ie:
Also, I'm receiving this Stripe error in my error console whenever I attempt to subscribe on my production environment, I am using the correct test credentials in the environment file:
Uncaught Error: You did not set a valid publishable key. Call Stripe.setPublishableKey() with your publishable key. For more info, see https://stripe.com/docs/stripe.js
at Function.b.validateKey ((index):3)
at Function.b.create ((index):2)
at Function.c.createToken ((index):2)
at o.subscribe (app.js:27)
at click (eval at pa (app.js:67), <anonymous>:3:52019)
at e (app.js:67)
at HTMLButtonElement.t._withTask.t._withTask (app.js:67)
In my .env file I have (I have put x's in for the purpose of this question, the env file has the real keys):
STRIPE_MODEL=App\User
STRIPE_KEY=pk_test_Nq6IKWIFjSaBFngxxxxxxxxx
STRIPE_SECRET=sk_test_T9lwCHZACcty5JUxxxxxxxxx
app/services.php and app/services-stripe.php both have these settings:
'stripe' => [
'model' => App\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
],
Any assistance is appreciated, thanks guys.
I had the same situation with the notifications. Apparently there's some kind of conflict with font awesome's spinner. I removed the icon completely and it's working now. Same with invitations, when I send an invitation, the text on the button changes but the spinner never hides.
I have problem,
when I send mail from localhost everything works fine,
but when send from server I don't receive mail and I don't get error.
My env. file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=xxxx#gmail.com
MAIL_PASSWORD=xxxx
and function
protected function contactMe() {
Mail::send('request2e', array(
'subject' =>Input::get("subject"),
'email' => Input::get("email"),
'message1' => Input::get("message1"),
'number' => Input::get("number")
), function ($message) {
$message->from('xxxx#gmail.com', 'Contact');
$message->to('yyyy#gmail.com')->subject('Contact');
});
return redirect('/');
}
Have any idea what could be the problem?
If you're using Gmail smtp you have to use the smtp driver:
MAIL_DRIVER=smtp
MAIL_PORT=587
MAIL_ENCRYPTION=tls
Make sure to clear the config cache if you have to (required in production).
php artisan config:cache
Everything else seems to be aok.
In your Gmail settings page do the following:
Click on the Forwarding/IMAP tab and scroll down to the IMAP Access section: IMAP must be enabled in order for emails to be properly copied to your sent folder.
I think you there is a problem with google app security functionality.
From above given link, turn on this functionality and check for this issue.
Hope this helps you.!
I'm trying to use mailgun to send notifications to users. I have verified domain, but even though my config\services.php file looks like this:
'mailgun' => [
'domain' => 'mg.mydomain.biz',
'secret' => 'key-3223423423n423j42jklkj23l',
],
all the emails go through sandbox domain.
php artisan config:clear does not help. It is the same with development and production environment. Also I need to point out that emails come from #maydomain.biz when config\mail.php clearly states 'from' => ['address' => 'no-reply#mg.mydomain.biz', 'name' => 'Sender'],. I channged it hours ago and cleared config cache un restarted web server since.
sudo service supervisor restart solved the problem.
I currently have a contact form on my website which sends off an email notification upon submission. It is working perfectly on my end and even when I send it externally to friends as a test they are receiving it.
My client however, who is in France, can't seem to receive this email at all and I have no idea why. Is there anything I need to do to ensure that they receive it? I thought it was something on their end but they're absolutely adamant that it's not and that it's a problem with my code. I have tried different email addresses for them with different domains and still no luck!
$this->load->library('parser');
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$this->load->library('email');
$data = array(
'first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
'email' => $this->input->post('email'),
'phone' => $this->input->post('phone'),
'message' => $this->input->post('message')
);
$body = $this->parser->parse('html_email', $data, true);
$this->email->from('test#test.com', 'Duparc');
$this->email->to('test#test.com');
$this->email->subject('Test Email');
$this->email->message($body);
$this->email->send();
In my opinion the problem does not originate from CodeIgniter. Assuming the mail did not went into a spam box, your customer's provider is probably dismissing your message for some other reason. One reason I can immediately think of is that you are probably trying to send a message from a domain (e.g. test.com) you're not allowed from. My advise is starting to try sending an email with another tool to your french customer (any sendmail or postfix client tool) and to see if he do receive it.
If that succeeds, then the problem probably comes from your forged email (therefore try using a valid domain name). Sometimes removing it completely will work too (it might then be replaced by the external IP).
If not, then the problem comes from your web server's config. I had this problem using postfix where I had to explicitly set the "General Options" > "What domain to use in outbound mail" configuration option to my domain name in order to be accepted by a capricious server which silently dismissed our mail.
If nothing is working, you might also use another mail server which might luckily fix the issue. Here is the code I used to force CodeIgniter using sendmail instead:
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$this->email->initialize($config);