News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

[TIP GUIDE] Setting up a gmail account on SMF

Started by Night09, October 19, 2009, 09:56:10 PM

Previous topic - Next topic

Night09

How to set up Gmail on your forums!

Please be aware recent Google changes mean you need to log into your Google control panel and set App security lower or you wont be able to send mail and you will get what appears as invalid login attempts. You can set up two stage login if you wish but this is only so you understand the reason why you may not be able to send mail.


Ive seen a few people looking for information about this recently and also faced this problem myself when it comes to setting up a gmail account to run from your forums.

There are 2 ways to do this really depending on how you decide to set this up.

1: You use a single address you have made from a google invatation like [email protected]
2: You set up a domain with google apps so you have your own domain like [email protected]

The basic SMF side will be the same for both really but with the google apps you can have up to 50 email addresses free with your sites url for the addresses.If you dont need that you use a single address you set up.

How to set it up for your forums using a single gmail account

Make a new email for your forums ensuring it has a decent password.
Login to your SMF Admin panel and open Server settings > Feature configuration

Set Mail type to:             SMTP
Set SMTP server to:         ssl://smtp.googlemail.com
Set SMTP port to:            465
Set SMTP username to:     [email protected]
Set SMTP password to:     Your email password
Confirm the password
Save the settings.

If you run Apache server ensure php_openssl is enabled in your php extensions or you wont be able to send mail using ssl://

If the above is done correctly you should now be able to let the forums send mail to verify accounts or newsletters ect.

The second way using your own domain is as follows

Create an account with google apps here http://www.google.com/apps/intl/en/group/index.html  You need your own url for this.

Once the account is created then if your on hosting it will give you the details of how to link to your host site.
If you own your own urls then you need to login to your url control panel and set the following MX records,They can be found under DNS settings:

(Save after each new MX entry,do not change the order of the contents,Make sure the . is on them all)


NAME:                                    PRIORITY:
ASPMX.L.GOOGLE.COM.                   10
ALT1.ASPMX.L.GOOGLE.COM.            20
ALT2.ASPMX.L.GOOGLE.COM.            20
ASPMX2.GOOGLEMAIL.COM.              30
ASPMX3.GOOGLEMAIL.COM.              30



You then need to set up a new CNAME entry with mail as the name and ghs.google.com. as the content.

On your forums you need to follow the steps above but replace the email address with your new domain one as follows:

Login to your SMF Admin panel and open Server settings > Feature configuration


Set Mail type to:                          SMTP
Set SMTP server to:                     ssl://smtp.googlemail.com
Set SMTP port to:                        465
Set SMTP username to:                 [email protected]
Set SMTP password to:                 Your email password
Confirm the password
Save the settings.


This should now work correctly and when it sends mail it will have the forums domain name and also you have the inbox you can log into for return mail.

Its important at this point on this second way using your domain to be patient since your MX records will take up to 48 Hours to resolve before you may actually be able to send mail.The google control panel will verify if this has happened or not.Once the MX records have propegated on the net you should then be able to use the mail for the forums without any issues.Dont be tempted to keep changing settings it wont work you just need to wait on this part for them.You can tell from control panel google give you when it is resolved.

You get up to 50 free mails on the standard free package and the option to upgrade but for guild sites and small forums it is nice to use your own domain for mails.

I hope this is of help to some of you who have had problems setting up gmail on your forums. ;)








vbgamer45

Nice guide only bad really is the email limits like you said.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Iz-no-gud

#2
Indeed, really good and thorough guide. I'm sure it will come handy to many users.
Thank you nightbre  ;)

mirahalo

really nice tip and guide ;)  very useful.  thanks.

Liam.

I was looking for something like this! Although I don't use GMail myself and won't use it just for this; this has given me a GREAT start on my custom email mod... =] Thanks!


humbleworld

If you have a big forum site that sends hundreds of notifications every your, google mail could pose a problem since there is a mail limit. I think it's 500 emails everyday?

Is there a way of avoiding this email sending limit? Then I won't hesitate to deploy the guide above.

Arantor

Quote from: humbleworld on October 26, 2009, 07:00:39 AM
Is there a way of avoiding this email sending limit? Then I won't hesitate to deploy the guide above.

Not really, unless you go for one of the bigger paid-for versions of Google's apps.

Garou

Ive been using Google apps for a while now and I highly recommend it. I wish you could mix the free and paid services on one account but its not possible at this time. There is a work around though, with domain names being so cheep through Go Daddy you can easily afford multiple URL's so get the dot com and net or whatever for your chosen URL.

Over on Google set up your main URL up with a paid account with one or 2 email addresses at $50 a pop per address, ouch. Then set up the secondary URL for the free service. This is the most cost effective way Ive found to use Google apps.

That said if you are paying for hosting your host should have some sort of mail server configured then you should be able to use the PHP default.

If you are running SMF off your own computer there are a few free and or cheep email servers you can install or you can usually set up an alternate email account through your ISP.

For myself I use the multiple Goggle apps accounts and a DNS provider separate from  my host. It makes it much easier to move hosts later on if you need to and its not that expensive in the long run. :)

JohnMig

Thanks for providing this unique information. I have never created my Gmail id for this purpose. So, I am going to try this one for sure.

Thanks,
Globester.com

bugzy


sirNemanjapro

Could not connect to SMTP host: 0 :
2: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.gmail.com:587 (Unknown error)
File: /home/xxx/public_html/forum2/Sources/Subs-Post.php
Line: 973

2: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: Failed to enable crypto
File: /home/xxx/public_html/forum2/Sources/Subs-Post.php
Line: 973

2: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: SSL operation failed with code 1. OpenSSL Error messages:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
File: /home/xxx/public_html/forum2/Sources/Subs-Post.php
Line: 973

Could not connect to SMTP host: 110 : Connection timed out
2: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)
File: /home/xxx/public_html/forum2/Sources/Subs-Post.php
Line: 973

Could not connect to SMTP host: 110 : Connection timed out
2: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)
File: /home/xxx/public_html/forum2/Sources/Subs-Post.php
Line: 973


It seams that whatever I do I cant get this to work. I am using 1.1.11, on a Apache 2.2 and MySQL 5.0.98. This is clean installation.

* xxx - deleted name of the account
None of the above applies.

Night09

Check your router and firewall that port 465 is open for google to use.

sirNemanjapro

LOL... It's on a server, a real net server, not my home.
None of the above applies.

Arantor

Same advice applies. My real net server has a form of router as well as a firewall for both in and out-bound communications.

sirNemanjapro

Solved. Changed SMTP/PHP and played with ssl setings..
None of the above applies.

willyboy

Quote from: sirNemanjapro on February 22, 2010, 03:52:46 AM
Solved. Changed SMTP/PHP and played with ssl setings..

hi, I have the same problem as you.
would you mind to tell us what are the steps you did to solve your problem.
I really appreciated.

BEH

I am trying for configuring smtp server settings for sending automatic mails through smf upon registration, activation, new post etc. to users, but facing difficulties from last few days. Still not able to configure.

Details:
I am hosting my site on freehostia: Although they don't provide outgoing smtp for my free hosting plan, but still smtp: hxxp:mbox.freehostia.com [nonactive] works perfectly for sending and receiving emails through microsoft outlook.

Firstly I tried:
Mail type        : SMTP
SMTP server       : hxxp:mbox.freehostia.com [nonactive] (it works on outlook)
SMTP port       : 25 (same on outlook)
SMTP username  : [email protected]   
SMTP password  : emailpassword

It gives the error @ error log:
fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to hxxp:mbox.freehostia.com [nonactive]:25 (Permission denied)
Now I thought that my host server may not be allowing to send mail (as not allowed in my plan (but still I am able to do that through outlook)) So I configured google app for my website as explained by nightbre in this post.

After successfully configuration, I tried following on outlook and it worked
Incoming mail server (POP3): hxxp:pop.gmail.com [nonactive] ; port: 995 ; ticked on: This server requires an encrypted connection (SSL)
Outgoing mail server (SMTP): smtp.gmail.com  ; port: 465 ; ticked on: This server requires an encrypted connection (SSL)

But when I am using this on smf server setting it is not working:
Trial:1
Mail type        : SMTP
SMTP server       : hxxp:smtp.gmail.com [nonactive]
SMTP port       : 465
SMTP username  : [email protected]   
SMTP password  : emailpassword

Error:
fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to hxxp:smtp.gmail.com [nonactive]:465 (Permission denied)

Trial:2
Mail type        : SMTP
SMTP server       : ssl://smtp.gmail.com
SMTP port       : 465
SMTP username  : [email protected]   
SMTP password  : emailpassword

Error:
fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.gmail.com:465 (Permission denied)

Trial:3
Mail type        : SMTP
SMTP server       : ssl://smtp.googlemail.com
SMTP port       : 465
SMTP username  : [email protected]   
SMTP password  : emailpassword

Error:
fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.googlemail.com
:465 (Permission denied)

I am puzzled; Please help!!!

BEH

Dear board members, Please help!
No response for my smtp problem (see above post).

Night09

I am using  :ssl://smtp.googlemail.com and port :465

If you check with your host ssl is working ok on the server and also delete your cookies if you have changed the settings as it may interfere with the new settings after a change.

If your email and password are correct then trial 3 should be working imo so theres another reason stopping this work right for you.I have mine set up to access the admin account with google for ref in case you are trying a user account you have created.I dont think it matters but just to be clear how im using it too.

Advertisement: