Error while sending email on GoDaddy Server: Laravel 5.1

前端 未结 6 1961
借酒劲吻你
借酒劲吻你 2020-12-17 03:50

I am using inbuilt template of Login System in Laravel 5.1

When I use Forgot Password on localhost, everything works. Below are my keys in .env file<

相关标签:
6条回答
  • 2020-12-17 04:31

    For Config email to your Laravel project first, create an email account in the host and check config details.

    Now config you .env file example:

    MAIL_DRIVER=mail
    MAIL_HOST=mail.22h.in
    MAIL_PORT=587
    MAIL_USERNAME=
    MAIL_PASSWORD=
    MAIL_ENCRYPTION=tls
    

    And your config/mail.php Should be like this.

    'from' => ['address' => 'demo@domain.in', 'name' => 'Order Receipt'],
    

    Clear your project cache and config , Run these command

    php artisan config:Cache
    php artisan cache:Clear
    
    0 讨论(0)
  • 2020-12-17 04:35

    Looking around web, it seems when using GoDaddy you need to use their relay SMTP with Gmail credentials when you want to send an e-mail.

    So in your .env file instead of:

    MAIL_HOST=smtp.gmail.com
    

    you should use

    MAIL_HOST=here_godaddy_relay_server
    

    The exact value of relay server depends on hosting you have but it will be probably relay-hosting.secureserver.net so try first with:

    MAIL_HOST=relay-hosting.secureserver.net
    

    Further details: https://www.godaddy.com/help/what-is-the-name-of-my-hosting-accounts-relay-server-953+&cd=2&hl=en&ct=clnk&gl=us

    0 讨论(0)
  • 2020-12-17 04:39

    Your env file must be like below

    MAIL_DRIVER=smtp
    MAIL_HOST=localhost
    MAIL_PORT=465
    MAIL_USERNAME=
    MAIL_PASSWORD=
    MAIL_ENCRYPTION=ssl
    

    In your config/mail.php, the from value should be like below...

    'from' => ['address' => 'pankaj@YourDomainName.com', 'name' => 'Sender Name'],
    

    What's your domain Name in from ? or you can say, How to create Email account in GoDaddy ?

    1. Login in your GoDaddy Account
    2. Go to your Hosting Account.
    3. Click Manage
    4. Under Email category, Please click Accounts
    5. Create an account if there is no email account.

    and that's it.

    So let's say you have email address like Pankaj@yourdomainname.com

    Now, put this email address in config/mail.php for from field. That's it.

    This will 100% fix the issue

    0 讨论(0)
  • 2020-12-17 04:47

    I had a hell of a time trying to find an answer to this so hopefully this helps someone. I was able to relay using my GoDaddy email account settings for a while but for whatever reason that stopped working. I'm now using the standard PHP Mail function to send emails and here's the .env config for that. Not sure if port or encryption are necessary but it's working so left it as is.

    MAIL_DRIVER=mail
    MAIL_HOST=localhost
    MAIL_PORT=465
    MAIL_USERNAME=
    MAIL_PASSWORD=
    MAIL_ENCRYPTION=ssl
    
    0 讨论(0)
  • 2020-12-17 04:48

    One of the reasons could be wrong Mail_RRIVER etc in the .env file. Please make sure you put the right information there, e. g. for GMAIL the following input will work!

    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.googlemail.com
    MAIL_PORT=465
    MAIL_USERNAME=**<YOUR_USER_NAME>**@gmail.com
    MAIL_PASSWORD=**<YOUR_PASSWORD>**
    MAIL_ENCRYPTION=ssl
    
    0 讨论(0)
  • 2020-12-17 04:55

    For my shared hosting at goDaddy

    I could configure my .env with the values from cPanel->Email Wizard->Configure Mail Client

    0 讨论(0)
提交回复
热议问题