Topic on Extension talk:ContactPage

This is how I got Gmail to work

2
Summary by Kghbln

See the post to this topic for the solution.

Fredrilj (talkcontribs)

Gmail refused to authenticate and the contact page served an error message when trying to send emails (something like this: "SMTP: Invalid response code received from server (code: 534, response...").

My solution:

  1. Allowing less secure apps to access your Gmail account. See instructions here: https://support.google.com/accounts/answer/6010255?hl=en
  2. Google have to allow your app/MediaWIki to use your own account. Log into your Gmail account. Go to https://accounts.google.com/DisplayUnlockCaptcha, then click continue, then within 10 min, try to send email again, and google will remember the application/MediaWiki and allow it to access your account (as long as you don't change your password).
  3. To get the SMTP to work I had to use "gmail.com" as my IDHost in the $wgSMTP setting.
  4. Set "$wgUserEmailUseReplyTo = true;"
  5. Change "'SenderEmail' => null, // Defaults to $wgPasswordSender" to "'SenderEmail' => 'myname@gmail.com', // Defaults to $wgPasswordSender", even if "myname@gmail.com" was the same as the email address I used for $wgPasswordSender. Otherwise the replay address would be the $wgPasswordSender and not the email address that the user wrote in the contact scheme.

I'm using an ordinary Gmail account, not G Suite (apps).

It took me some time to figure this out (and to find out that my host did not support sending emails through web applications), so hopefully this can help somebody. Fredrilj (talk) 20:10, 1 April 2017 (UTC)

Kghbln (talkcontribs)

Cool, thanks a lot for sharing this with us!