smtp setting for gmail

irs_spryker
irs_spryker Posts: 16 🧑🏻‍🚀 - Cadet

I am working on sending mail through gmail smtp but dont know where to do the smtp settings for the same, can anyone help me please. i tried to do settings in config_default but i dont thing it is the correct place.

Answers

  • profuel
    profuel SSA Sprykee Posts: 106 🪐 - Explorer

    config_default is the correct place.

    $config[MailConstants::SMTP_HOST] = env('SPRYKER_SMTP_HOST') ?: null;
    $config[MailConstants::SMTP_PORT] = env('SPRYKER_SMTP_PORT') ?: null;
    $config[MailConstants::SMTP_ENCRYPTION] = env('SPRYKER_SMTP_ENCRYPTION') ?: null;
    $config[MailConstants::SMTP_AUTH_MODE] = env('SPRYKER_SMTP_AUTH_MODE') ?: null;
    $config[MailConstants::SMTP_USERNAME] = env('SPRYKER_SMTP_USERNAME') ?: null;
    $config[MailConstants::SMTP_PASSWORD] = env('SPRYKER_SMTP_PASSWORD') ?: null;
    

    These are you configs, just get the values from your GMail account, and put here.

    It might require you to enable unsafe sending of emails, at least that's what I remember doing last time some years ago.

    p.s. for local testing using MailCatcher is usually enough.