Google Apps Mail with DotNetNuke

I was recently having a problem with the mail on the site.  I had switched from the host provided email server to Google Apps email, but in some cases email was being delivered to the wrong place.   It turned out that this was because I had the host's email server still set up in the SMTP settings in DotNetNuke.  The aliases on this domain change quite a bit as different officers take over and they keep the same alias but point to a new destination address.  For instance, the King and Queen of Atenveldt rotate twice a year, the crown (at) address will always be available but point to the new King and Queen as they take over from the old set. 

The issues presented themselves when the DotNetNuke (or a particular module) was trying to send to someone at an address. The host's email server thought it was still the email service for that domain and didn't bother to check DNS to see if that was still true, so the people who were set up in the old alias were getting that email rather than the people we had changed over to get email from the Google Apps group that we set up.

I couldn't just have the host take off the domain from the server because then the site wouldn't be able to email because it won't relay.

The solution to this was to use Google's SMTP server.  Once I set up a google apps account that was specific to the website, I had DotNetNuke use those credentials to log in to the SMTP server and send email. The email coming from the site would appear to be coming from website (at) (even if a module tried to send out from a different address.  This is an effect of using the google smtp.)  A potential security hole exists in that all mail sent is now being saved in the website's google apps email box.  This means that when the DNN site sends out passwords and such, a record of it will be in that account's sent items. 

The benifits of using Google Apps for this setup is pretty nice.  Our mail is no longer tied to the host, so if we decide to leave this host and go to a new one, email will be one less thing we have to worry about.  There are some other benefits to the Google Apps for our organization in terms of shared calendar and docs.