Use Google Apps Gmail to Send Email From Your Domain

I have been using and reccomending Google Apps for Business for almost a year now.  It is a wonderful time saver (especially for a programmer who doubles as IT guy). Google essentially offers your business to move all of their office features, including email, into Google’s cloud.  You can brand everything and you have the reliability and ease of use that Google provides in Gmail, Google Docs, Google Calendar, Google Talk and more.  Check out Google Apps for business.  It is simple to add users and manage everything from the control panel, it is everything you would expect from Google.

I did not put much effort into it, but when I first switched over I could not get my websites emailing agent to work with it.  Since we had ten months left on our current email contract, I never looked into it again.  Now that the other contract has expired, I am forced to use a new mailing service.  I tried setting it up as if it were Gmail, read through all sorts of articles on how to use Gmail as the agent and still no luck.

After hours of just playing around with settings, I am now able to send email through gmail from my own domain.  The only issue that I have come across is that unlike other services, you cannot specify who the email is coming from.  Gmail automatically strips that information out and replaces it with the account you use to login in to’s default information.  You can change the default information from inside of Gmail under Settings -> Accounts.

 

using System.Net.Mail;
private void SendMail()
{
MailMessage message = new MailMessage();
message.To.Add( "[email protected]" ); 
message.From = new MailAddress( "[email protected]", "Name to Display"
System.Text.Encoding.UTF8 );
message.Subject = "Testing";
message.SubjectEncoding = System.Text.Encoding.UTF8; 
message.Body = "Testing 123";
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = false;
message.Priority = MailPriority.Normal;
SmtpClient emailClient = new SmtpClient();
emailClient.Credentials =  new NetworkCredential( "[email protected]", "yourpassword" );
emailClient.Port = 587;
emailClient.Host = "smtp.gmail.com"
emailClient.EnableSsl = true; 
emailClient.Send( message );
}

54 comments » Write a comment

  1. @dgxshiny17

    Any chance you know how to re-create this capability on the iPhone? I set up my main Google Apps domain as the default mail account on the iPhone, but I want to be able to send through my other domains as well, and haven’t been able to figure it out. I enabled the smtp server for the other domain, but it still doesn’t show up as an option to send from the other domain when I draft an email… If you happen to know what i’m doing wrong, I’d love to hear it! Thanks!

  2. Is that legal. It almost sound like a spamming tactic. I guess it has to be from your domain though, right?

  3. The above code will throw an exception

    "the type or namespace name ‘NetworkCredential’ could not be found"

    use the name spcae of System.Net.NetworkCredential to over come the code

  4. I had the same problem as you Fahad, but had it working by doing this :
    emailClient.Credentials = New System.Net.NetworkCredential("email","password")
    …. and by the way – remove the last dot in "smtp.gmail.com."

  5. Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! I’m sure you had fun writing this article.

  6. Hey You really did a good job for others who are not knowing the utilization of Google Domain apps..This will really people to integrate and to make the google domain apps to there maximum usage in business purpose..Keep it up and Keep on posting…

  7. I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!

  8. I am about to start a blog and your blog gave me much hint how to do it. I really loved to visit your blog. Hope to see more inputs from you in your blog.

  9. I am about to start a blog and your blog gave me much hint how to do it. I really loved to visit your blog. Hope to see more inputs from you in your blog.

  10. Google Apps is great, but I have not figured out all of the specifics with this sort of thing. Thanks for your post and I hope you will keep posting as you fin other things that are helpful to users.
    If you are a non-profit or education user, don’t forget that you can get this for free. Thanks again.

  11. I don’t know if it’s only me but something is always wrong with the google. There hasn’t been a day when I’ve not came accross a problem. But then again it could have something to do with my computer.

  12. I don’t know if it’s only me but something is always wrong with the google. There hasn’t been a day when I’ve not came accross a problem. But then again it could have something to do with my computer.

  13. I don’t know if it’s only me but something is always wrong with the google. There hasn’t been a day when I’ve not came accross a problem. But then again it could have something to do with my computer.

  14. I set up my main Google Apps domain as the default mail account on the iPhone, but I want to be able to send through my other domains as well, and haven’t been able to figure it out. Your article is very helpful for me. Thanks for sharing this with us.

  15. You say almost everything that Im pondering and a lot more. Youve surely shed light on the topic that not many individuals can argue with. Youre so fine at getting what you wish to say available in the way thats intelligent and entertaining. Im seriously impressed!

  16. It is a great webpage posting, im happy I stumbled onto it. Unwell be back again down the track to examine out other posts that you just have in your blog site.

  17. I seriously enjoyed the top quality facts you present for your website visitors for this weblog. I arrive here every one of the time and am very satisfied with your updates. I could not detect this sort of dissertation strategy in World wide web and wanted to purchase the thesis. This web site is valuvable for me.

  18. Great website…and cool article man…thanx for the great post…keep on posting such articles… Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful.

  19. I like the Iphone 4 nevertheless I’m seriously discouraged due to the fact I am having lots of difficulties with it. However I cannot wait to check out the Iphone 5.

  20. ppghaboofibppkrrvshaa <a href="http://www.certified-financial-planner.info/">certified financial planner</a> eahrphfcckjjhafftcrhqmk <a href="http://www.certified-financial-planner.info/">certified financial planner</a> ecnvbvsqnieajekqmcaavd <a href="http://www.certified-financial-planner.info/certified-financial.html">certified financial</a> enfspbsdctpdikmkdhhftohj <a href="http://www.certified-financial-planner.info/registered-financial-planner.html">registered financial planner</a> smjshdhsqnlctbheoovhegiao <a href="http://www.certified-financial-planner.info/chartered-financial-planner.html">chartered financial planner</a> dsqeikqnchbhasdpicdddae <a href="http://www.certified-financial-planner.info/certified-financial-adviser.html">certified financial adviser</a> kokphpvklahfclrhiakcjhe <a href="http://www.mortgage-finance-calculator.com/">calculator mortgage</a> tldhgtsbgkvghnessniakfe <a href="http://www.mortgage-finance-calculator.com/calculators-mortgage.html">calculators mortgage</a> fabhmmencraodpehbhfhlnah <a href="http://www.mortgage-finance-calculator.com/amortization-calculator.html">amortization calculator</a> mkdamkaacckkhtseifdds <a href="http://www.mortgage-finance-calculator.com/mortgage-home-loan.html">mortgage home loan</a> vhdcjllnkhmeskcppdhqpssrc <a href="http://www.mortgage-finance-calculator.com/home-loan-calculator.html">home loan calculator</a> crbvhctkqechtrhcihthrekqr <a href="http://www.property-loan.org/">property loan</a> khisrkcpabckaagblsgobhrtc <a href="http://www.property-loan.org/home-loan-interest.html">home loan interest</a> nsjkogmgdtmqsprecjsaglrbk <a href="http://www.property-loan.org/home-improvement-loans.html">home improvement loans</a> hbgfolirrpksnnlnhtvonq <a href="http://www.property-loan.org/housing-loan-interest-rates.html">housing loan interest rates</a> dkeosskdllmnltspsleoirbko <a href="http://www.property-loan.org/home-loan-interest-rates.html">home loan interest rates</a>

  21. Each man takes care that his neighbor shall not cheat him. But a day comes when he begins to care that he does not cheat his neighbor. Then all goes well. He has changed his market-cart into a chariot of the sun.

Leave a Reply

Required fields are marked *.