DEV Community

Supraja Tangella
Supraja Tangella

Posted on

๐Ÿš€ ๐—ฆ๐—ผ๐—น๐˜ƒ๐—ถ๐—ป๐—ด ๐—š๐—บ๐—ฎ๐—ถ๐—น ๐—ฆ๐— ๐—ง๐—ฃ ๐—œ๐˜€๐˜€๐˜‚๐—ฒ๐˜€ ๐—ถ๐—ป ๐—”๐—ฆ๐—ฃ.๐—ก๐—˜๐—ง ๐—–๐—ผ๐—ฟ๐—ฒ! ๐Ÿ”ฅ

Today, I faced some issues while sending emails using ๐—š๐—ผ๐—ผ๐—ด๐—น๐—ฒ ๐—ฆ๐— ๐—ง๐—ฃ in ๐—”๐—ฆ๐—ฃ.๐—ก๐—˜๐—ง ๐—–๐—ผ๐—ฟ๐—ฒ. After debugging, I found the solutions! Hereโ€™s what happened and how I fixed it.

1๏ธโƒฃ ๐—ฆ๐— ๐—ง๐—ฃ ๐—–๐—ผ๐—ป๐—ป๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐—™๐—ฎ๐—ถ๐—น๐—ฒ๐—ฑ: I tried to send an email, but it didnโ€™t work.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I checked my SMTP settings and confirmed the correct server details.

2๏ธโƒฃ ๐—ง๐—ฒ๐—น๐—ป๐—ฒ๐˜ ๐—ก๐—ผ๐˜ ๐—™๐—ผ๐˜‚๐—ป๐—ฑ: I tried to check SMTP connectivity using telnet, but it wasnโ€™t recognized.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I enabled ๐—ง๐—ฒ๐—น๐—ป๐—ฒ๐˜ ๐—–๐—น๐—ถ๐—ฒ๐—ป๐˜ using ๐—–๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ ๐—ฃ๐—ฟ๐—ผ๐—บ๐—ฝ๐˜.

3๏ธโƒฃ ๐—ก๐—ผ ๐—ฅ๐—ฒ๐˜€๐—ฝ๐—ผ๐—ป๐˜€๐—ฒ ๐—ณ๐—ฟ๐—ผ๐—บ ๐—ฆ๐—ฒ๐—ฟ๐˜ƒ๐—ฒ๐—ฟ: The error โ€œ๐—–๐—ผ๐—ป๐—ป๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป ๐—ฎ๐˜๐˜๐—ฒ๐—บ๐—ฝ๐˜ ๐—ณ๐—ฎ๐—ถ๐—น๐—ฒ๐—ฑโ€ appeared.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I tested my connection using ๐—–๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ ๐—ฃ๐—ฟ๐—ผ๐—บ๐—ฝ๐˜ (๐˜๐—ฒ๐—น๐—ป๐—ฒ๐˜ ๐˜€๐—บ๐˜๐—ฝ.๐—ด๐—บ๐—ฎ๐—ถ๐—น.๐—ฐ๐—ผ๐—บ ๐Ÿฑ๐Ÿด๐Ÿณ).

4๏ธโƒฃ ๐—š๐—บ๐—ฎ๐—ถ๐—น ๐—”๐—ฝ๐—ฝ ๐—ฃ๐—ฎ๐˜€๐˜€๐˜„๐—ผ๐—ฟ๐—ฑ ๐— ๐—ถ๐˜€๐˜€๐—ถ๐—ป๐—ด: I couldnโ€™t find an option to select "๐— ๐—ฎ๐—ถ๐—น" when generating an App Password.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I entered a custom ๐—”๐—ฝ๐—ฝ ๐—ก๐—ฎ๐—บ๐—ฒ and generated a ๐Ÿญ๐Ÿฒ-๐—ฐ๐—ต๐—ฎ๐—ฟ๐—ฎ๐—ฐ๐˜๐—ฒ๐—ฟ ๐—”๐—ฝ๐—ฝ ๐—ฃ๐—ฎ๐˜€๐˜€๐˜„๐—ผ๐—ฟ๐—ฑ.

5๏ธโƒฃ ๐—œ๐—ป๐—ฐ๐—ผ๐—ฟ๐—ฟ๐—ฒ๐—ฐ๐˜ ๐—จ๐˜€๐—ฒ๐—ฟ๐—ป๐—ฎ๐—บ๐—ฒ/๐—ฃ๐—ฎ๐˜€๐˜€๐˜„๐—ผ๐—ฟ๐—ฑ: Gmail rejected my credentials.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I used my ๐—ณ๐˜‚๐—น๐—น ๐—š๐—บ๐—ฎ๐—ถ๐—น ๐—ฎ๐—ฑ๐—ฑ๐—ฟ๐—ฒ๐˜€๐˜€ as the username and the ๐—”๐—ฝ๐—ฝ ๐—ฃ๐—ฎ๐˜€๐˜€๐˜„๐—ผ๐—ฟ๐—ฑ instead of my regular password.

6๏ธโƒฃ ๐—ฃ๐—ผ๐—ฟ๐˜ ๐—œ๐˜€๐˜€๐˜‚๐—ฒ๐˜€: ๐—ฃ๐—ผ๐—ฟ๐˜ ๐Ÿฑ๐Ÿด๐Ÿณ (๐—ง๐—Ÿ๐—ฆ) wasnโ€™t working.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: ๐—œ ๐˜€๐˜„๐—ถ๐˜๐—ฐ๐—ต๐—ฒ๐—ฑ ๐˜๐—ผ ๐—ฃ๐—ผ๐—ฟ๐˜ ๐Ÿฐ๐Ÿฒ๐Ÿฑ (๐—ฆ๐—ฆ๐—Ÿ) ๐—ฎ๐—ป๐—ฑ ๐—ฒ๐—ป๐—ฎ๐—ฏ๐—น๐—ฒ๐—ฑ ๐—˜๐—ป๐—ฎ๐—ฏ๐—น๐—ฒ๐—ฆ๐˜€๐—น = ๐˜๐—ฟ๐˜‚๐—ฒ.

7๏ธโƒฃ ๐—™๐—ถ๐—ฟ๐—ฒ๐˜„๐—ฎ๐—น๐—น ๐—•๐—น๐—ผ๐—ฐ๐—ธ๐—ถ๐—ป๐—ด ๐—ฆ๐— ๐—ง๐—ฃ: My firewall was stopping the SMTP connection.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I allowed ๐—ฆ๐— ๐—ง๐—ฃ (๐—ฃ๐—ผ๐—ฟ๐˜ ๐Ÿฑ๐Ÿด๐Ÿณ ๐—ฎ๐—ป๐—ฑ ๐Ÿฐ๐Ÿฒ๐Ÿฑ) ๐—ถ๐—ป ๐—ช๐—ถ๐—ป๐—ฑ๐—ผ๐˜„๐˜€ ๐—™๐—ถ๐—ฟ๐—ฒ๐˜„๐—ฎ๐—น๐—น.

8๏ธโƒฃ ๐—ง๐—ถ๐—บ๐—ฒ๐—ผ๐˜‚๐˜ ๐—˜๐—ฟ๐—ฟ๐—ผ๐—ฟ๐˜€: My app kept failing due to timeout issues.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I increased the ๐—ง๐—ถ๐—บ๐—ฒ๐—ผ๐˜‚๐˜ ๐˜ƒ๐—ฎ๐—น๐˜‚๐—ฒ in my SMTP settings.

9๏ธโƒฃ ๐— ๐—ถ๐˜€๐˜€๐—ถ๐—ป๐—ด ๐—ฆ๐—ฆ๐—Ÿ/๐—ง๐—Ÿ๐—ฆ ๐—ฆ๐—ฒ๐˜๐˜๐—ถ๐—ป๐—ด๐˜€: The error "๐—ฆ๐˜†๐—ป๐˜๐—ฎ๐˜… ๐—ฒ๐—ฟ๐—ฟ๐—ผ๐—ฟ, ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ ๐˜‚๐—ป๐—ฟ๐—ฒ๐—ฐ๐—ผ๐—ด๐—ป๐—ถ๐˜‡๐—ฒ๐—ฑ" appeared.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I made sure ๐—˜๐—ป๐—ฎ๐—ฏ๐—น๐—ฒ๐—ฆ๐˜€๐—น = ๐˜๐—ฟ๐˜‚๐—ฒ for secure email sending.

๐Ÿ”Ÿ ๐—ฆ๐˜๐—ถ๐—น๐—น ๐—ก๐—ผ๐˜ ๐—ช๐—ผ๐—ฟ๐—ธ๐—ถ๐—ป๐—ด? I debugged and logged errors to find the exact problem.

โœ… ๐—ฆ๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป: I wrapped my SMTP code in a ๐˜๐—ฟ๐˜†-๐—ฐ๐—ฎ๐˜๐—ฐ๐—ต ๐—ฏ๐—น๐—ผ๐—ฐ๐—ธ to log detailed errors.

Top comments (0)