# Mail sending error with gmail smtp

**URL:** <https://forum.xwiki.org/t/mail-sending-error-with-gmail-smtp/12779>\
**Category:** Help / Discuss\
**Tags:** email, error, google\
**Created:** [July 3, 2023, 7:16pm UTC](https://forum.xwiki.org/t/mail-sending-error-with-gmail-smtp/12779 "2023-07-03T19:16:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GarbatyGrabarz](https://forum.xwiki.org/user_avatar/forum.xwiki.org/garbatygrabarz/32/4834_2.png) [@GarbatyGrabarz](https://forum.xwiki.org/u/GarbatyGrabarz)\
**Post date:** [July 3, 2023, 7:16pm UTC](https://forum.xwiki.org/t/mail-sending-error-with-gmail-smtp/12779/1 "2023-07-03T19:16:31Z")

</div>

Hi,  
I am getting a send\_error when trying to send email through gmail.

I have followed [this guide](https://extensions.xwiki.org/xwiki/bin/view/Extension/Mail/MailApplication) and set as follows:

**email address to send from** : `<mygmailaccount>@gmail.com`  
**email server** : `smtp.gmail.com`  
**email server port** : `587`  
**email server username** : `<mygmailaccount>@gmail.com`  
**email server password** : `<my_app_password>`  
**Additional properties** : `mail.smtp.starttls.enable=true`  
**Discard sucess statuses?** : `No`

When I trigger an email send (password reset on one of the users) I got this error:

> `AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials y16-20020a2e9790000000b002b6d465583csm2455320lji.126 - gsmtp`

What could be the problem? Any buried settings in config files? Permissions? Something to set up on my gmail account?

What am I missing?

---

<div class="post-metadata">

**Author:** ![acotiuga](https://forum.xwiki.org/user_avatar/forum.xwiki.org/acotiuga/32/3815_2.png) [@acotiuga](https://forum.xwiki.org/u/acotiuga)\
**Post date:** [July 4, 2023, 6:45am UTC](https://forum.xwiki.org/t/mail-sending-error-with-gmail-smtp/12779/2 "2023-07-04T06:45:58Z")

</div>

Hi @GarbatyGrabarz,

Please read [Sign in with app passwords - Google Account Help](https://support.google.com/accounts/answer/185833?hl=en). It is now required that you create an application password to be used with your email instead of your actual password.

Hope it helps,  
Alex

---

<div class="post-metadata">

**Author:** ![GarbatyGrabarz](https://forum.xwiki.org/user_avatar/forum.xwiki.org/garbatygrabarz/32/4834_2.png) [@GarbatyGrabarz](https://forum.xwiki.org/u/GarbatyGrabarz)\
**Post date:** [July 4, 2023, 7:24am UTC](https://forum.xwiki.org/t/mail-sending-error-with-gmail-smtp/12779/3 "2023-07-04T07:24:51Z")

</div>

I did that already (that’s why `<my_app_password>`).  
When asked for selecting type of app I tried with “Mail” and “Other”.
