Jump to content

How to make Google Apps for Your Domain work with WHMCS in 5 steps


Gears

Recommended Posts

Hello,

 

I figured I would share with you how to setup Google Apps to work with WHMCS Support since I figured it out myself. With this way, you can use multiple support departments despite Gmail rewriting the from address. I suggest reading the entire thing over first, then follow each step.

 

 

Step 1 - Sign up for Google Apps

 

A. Visit http://www.google.com/apps/intl/en/business/ and sign-up. For those of you in need of a free edition, use this link: http://www.google.com/apps/intl/en/business/editions.html

 

B. Verify your domain by uploading the .html file or adding the cname record

 

C. Follow the instructions for configuring Google Apps and configuring your DNS. You will need to change and add MX records, add cname records, etc. You should be able to find help at Google if you need it. Note: this will make your old setup no longer work. I am listing this in Step 1 so it gives time to propagate.

 

 

 

Step 2 - Create Email Accounts

 

A. From within your new Google Apps dashboard, create your email addresses according to your departments (ie. support@example.com, sales@example.com, etc). The passwords can all be the same if the password is strong enough. However, you may want to consider having them all be different.

 

B. Create another email account such as main@example.com, info@example.com, hello@example.com, etc. Use a strong password.

 

C. Log in to each of the new email accounts to activate them. Enable POP and IMAP while you are logged in.

 

 

 

Step 3 - Support Departments in WHMCS

 

A. From within WHMCS, create or edit your support departments. Use the following information:

 

hostname: pop.gmail.com

port: 995

user: youremail@yourdomain.com

pwd: yourpassw0rd

 

Be sure that you have Imap-SSL/Pop3-SSL enabled on your server. Check to see if your server/firewall permits the connection: telnet gmail-pop.l.google.com 995

 

B. Create the cron job: "*/5 * * * * php -q /home/username/public_html/whmcs/pipe/pop.php" Note: you may want to alter the minutes so that the emails are imported faster than 5 minutes.

 

 

 

Step 4 - SMTP in WHMCS

 

A. Refer to http://forum.whmcs.com/showthread.php?t=13845 (easiest thing to do here is download the new files from http://sws.vxcomputers.com/includes.zip). Note: backup your database and backup the two individual files you will be overwriting. Not responsible for any data loss or issues.

B. Go to Configuration > Mail

 

Mail Type - SMTP

SMTP Port - 587 (make sure this isn't blocked on your server/firewall)

SMTP Host - tls://smtp.gmail.com

SMTP Username: enter in that 'main' email address you made. (ie. main@example.com, info@example.com)

SMTP Password: your_strong_password

 

 

 

Step 5 - The Trick

 

A. This is the part I figured out that makes this possible. It is the key to making this work with multiple departments. Log into your 'main' email account (ie. main@example.com, info@example.com). Click the "Settings" link in the top right corner. Click the "Accounts" tab. In the "Send mail as:" section, click the "Add another email address you own" link. Enter in the name of the department (ie. Company Support or Company Sales) and enter in the respective email address. Click the "Next" button. Send the verification. Wait until you get a new support ticket in WHMCS. In the new ticket, find the verification code and paste it into the pop box that is open from your Google Apps accounts.

 

B. Repeat Step 4 A for as many departments as you have

 

 

 

 

Note: Step 4 will enable you to have multiple support departments and will prevent your email from being marked as spam. Some providers such as Hotmail will show your emails as "From Company <mail@example.com> on Behalf of Company Support <support@example.com>". I don't see a workaround for this and it doesn't really bother me. When they click the "Reply" button, it will reply to the respective department. The only way to totally stop this is to enable SMTP credentials at the department level rather than globally (in whmcs).

 

I don't think I missed anything, but if you need help just reply.

 

Regards,

Anthony

Edited by Gears
Link to comment
Share on other sites

It allows you to setup multiple email accounts in Gmail, so that when you receive an email from a user saying "help my email is on fire", you can respond to their question from a set email address.

i.e. Support@hosting-domain.com

 

Rather than from Bob.smith@gmail.com

 

This is why we need to setup gmail to support sending this mail to users under multiple identities, i.e.

Accounts

Billing

Support

Sales

Sales Support

etc...

 

Does that make sense now?

 

 

p.s. This method won't work, as STUPID Gmail will always add a little message to the header changing the:

 

From: support@web-hosting.com on behalf of bob.smith@gmail.com

To: customer@alpha.com

Subject: Support Ticket #1929303

 

i.e. Gmail are rather frustrating... even after validating your email address with them!

:(

Link to comment
Share on other sites

It allows you to setup multiple email accounts in Gmail, so that when you receive an email from a user saying "help my email is on fire", you can respond to their question from a set email address.

i.e. Support@hosting-domain.com

haha

 

p.s. This method won't work, as STUPID Gmail will always add a little message to the header changing the:

 

This method will work and does work. Why do I see @gmail.com in your post? Do not make such accusations if you are not even doing it correctly.

Edited by Gears
Link to comment
Share on other sites

Don't really understand why you need to go messing around with SMTP we've been using something similar but simpler

 

First Setup up ticket piping for your emails and support then on your administrator setting setup ticket notification to on

then login to your gmail account (any gmail account) then go to settings -- accounts -- add another email address confirm it

 

then your done all your tickets alert you via email when you respond the they pipe back from the email you choose

Link to comment
Share on other sites

-Jessica;93483']Don't really understand why you need to go messing around with SMTP we've been using something similar but simpler

 

First Setup up ticket piping for your emails and support then on your administrator setting setup ticket notification to on

then login to your gmail account (any gmail account) then go to settings -- accounts -- add another email address confirm it

 

then your done all your tickets alert you via email when you respond the they pipe back from the email you choose

 

Thank you for the information, but I think you are mistaken as to what this thread is for.

Link to comment
Share on other sites

For anyone else that reads this thread, please read the following information clearly before submitting any comments.

 

This thread is a How To for outsourcing your email and support tickets to Gmail. By Gmail I mean Google Apps for Your Domain. I would never use the free Gmail service for this. This thread refers to Google Apps for Your Domain.

 

Again, this is for people who prefer to use a remote mail server with advanced spam protection and 99.9% guaranteed uptime (Gmail) instead of their local mail.

 

If you have legitimate questions, I will be glad to help.

Link to comment
Share on other sites

This works fine. Thanks for the info, Gears. I'd make use of this "allow list" before, but didn't remember it would be why Gmail block us to use other address to support departments.

 

However, like I replied you by PM, I will inform those who are reading this thread:

 

if php mail() function works on your servers, it's way easier to NOT select to use SMTP to send e-mails. Just add an SPF record on your DNS (what should be made no matter you use WHMCS or not, it should be done to avoid your e-mails goes to SPAM folder in any server, not only hotmail, and not only the WHMCS automatic mails, but all e-mails that come from your domain), create your support departments, and enable POP in each account. No IMAP required. You will use POP importing like this tutorial teach you to do, but not the SMTP to send, only PHP.

 

I'm using it currently with Google Apps, and I didn't need to allow each address, as all address use their own passwords to retrieve the e-mails (POP), and the PHP can send the e-mails as any address if the SPF records is added.

 

The SPF records can be (include quotes in cPanel):

 

yourdomain.com. 14400 IN TXT "v=spf1 include:aspmx.googlemail.com ~all"

 

If you use LxAdmin you should create it without the quotes. I can't remember on other panels. Btw, you can check your SPF records using http://www.iptools.com (the first central form) -- if you place it wrong, you will see:

 

"v=spf1" "include:aspmx.googlemail.com" "~all"

 

If you place it correctly, you will see all the command without quotes (or a unique quote in the entire phrase) -- example here

 

You can read more about the SPF records for Google Apps here: http://www.google.com/support/a/bin/answer.py?hl=en&answer=33786

 

Regards,

Renato

Edited by RenatoMN
Link to comment
Share on other sites

I am rewriting the post and will ask Matt to delete the post above, I was not clear there.

 

---

 

This works fine. Thanks for the info, Gears. I'd make use of this "allow list" before, but didn't remember it would be why Gmail block us to use other address to support departments.

 

However, like I replied you by PM, I will inform those who are reading this thread:

 

If php mail() function works on your servers, it's way easier to NOT select to use SMTP to send e-mails. Just add an SPF record on your DNS (what should be made no matter you use WHMCS or not, it should be done to avoid your e-mails goes to SPAM folder in any server, not only hotmail, and not only the WHMCS automatic mails, but all e-mails that come from your domain), create your support departments, and enable POP in each account. No IMAP required. You will use POP importing like this tutorial teach you to do, but not the SMTP to send, only PHP.

 

I'm using it currently with Google Apps, and I didn't need to allow each address, as all address use their own passwords to retrieve the e-mails (POP), and the PHP can send the e-mails as any address if the SPF records is added. Let's configure SPF:

 

If you use exclusively SMTP (like explained on the first post by Gears) the SPF records can be (include quotes in cPanel):

 

yourdomain.com. 14400 IN TXT "v=spf1 include:aspmx.googlemail.com ~all"

 

Note: if you use LxAdmin or the DremHost Panel you should create it without the quotes. I can't remember on other panels. Btw, you can check your SPF records after creating it at http://www.iptools.com (the first central form) -- if you place it wrong, you will see additional quotes between the words like:

 

"v=spf1" "include:aspmx.googlemail.com" "~all"

 

If you place it correctly, you will see all the command without quotes (or a unique quote in the entire phrase) -- example here

 

You can read more about the SPF records for Google Apps here: http://www.google.com/support/a/bin/answer.py?hl=en&answer=33786

 

For those who don't need SMTP (PHP mail() working), just add your hosting server hostname, your MX, or the SPF of additional domains in your SPF (deploy your SPF records here).

 

You can also find your mail server name sending an e-mail for yourself and clicking in the "show original" link. e.g.:

 

Received: from crusty.g.dreamhost.com (crusty.g.dreamhost.com [67.205.8.12])

 

My SPF is: "v=spf1 ip4:67.205.8.12 mx a:crusty.g.dreamhost.com include:aspmx.googlemail.com ?all"

 

ip4 entry is the IP of my mailserver at DreamHost

mx means the google servers are also allowed to send emails (for when I use webmail)

a entry are for hostnames (crusty.g.dreamhost.com) -- i already added the IP, but it may change

include entry for aspmx.googlemaiil.com is for when I use SMTP to send e-mails (I don't use it on WHMCS, but in other systems)

 

Regards,

Renato

Link to comment
Share on other sites

Renato,

 

You mentioned that we do not have to use SMTP. This is true. But you continued with describing how to implement an SPF record that will allow the sending of mail with Google's SMTP server. No need for clarification as Google details how to do this already. In other words when following my 5 steps, Google will display the exact SPF record that is needed.

 

The main purpose of this thread is to share with people how to use Google Apps for Your Domain with SMTP. There are many people already using Google Apps, I just wanted to offer some help for those who were having issues with SMTP. Thank you for your contribution, but you could really have just wrote "Just to let everyone know, you don't have to use SMTP; you can still use the phpmail function". Honestly I think you are adding more confusion here.

 

Perhaps you should have started a new thread titled "How to implement an SPF record". And maybe I should have "(with SMTP)" added to this thread's title.

 

Anthony

Link to comment
Share on other sites

Thanks for your time to make this tutorial. i will bookmark this

 

Thank you. Let me know if you need any assistance, I've been using it for awhile so I'm fairly familiar with it.

 

Only downfall is the "Email sent on Behalf of" that appears in hotmail/live... but it's not that big of a deal to me.

Link to comment
Share on other sites

  • 2 weeks later...

Gears,

 

Thanks for the great tutorial. I am having some issues, tho. I have a support account setup and entered all the info into the support department as you stated. I sent a test email to the support account and ran the pop.php script and it didn't pick up the email. It didn't give any errors either. It just showed "POP Import", the server info and email address. Any ideas what I might've missed? Is there a way to "debug" that pop.php script to see if it is throwing any errors that might be suppressed?

 

Thanks!

Link to comment
Share on other sites

Gears,

 

Thanks for the great tutorial. I am having some issues, tho. I have a support account setup and entered all the info into the support department as you stated. I sent a test email to the support account and ran the pop.php script and it didn't pick up the email. It didn't give any errors either. It just showed "POP Import", the server info and email address. Any ideas what I might've missed? Is there a way to "debug" that pop.php script to see if it is throwing any errors that might be suppressed?

 

Thanks!

 

Do you experience any issues when you run the following command:

 

telnet gmail-pop.l.google.com 995

Link to comment
Share on other sites

Do you experience any issues when you run the following command:

 

telnet gmail-pop.l.google.com 995

 

Nope, I tested it already:

 

Trying 74.125.93.111...

Connected to gmail-pop.l.google.com.

Escape character is '^]'.

 

This is all I get from the php command:

 

<b>POP Import Log</b><br>Date: 24/03/2009 22:49:21<hr>Host: pop.gmail.com<br>Email: support@xxxxxxxxxx.com<br>

 

Anything else I can try? I'm using 3.8.2 with the files you made available.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated