Hi Hugo, I don't believe this is possible with the Email Settings API. There are several restrictions:
*Note:* A valid value of *forwardTo* is an email address that has been already verified to be used as a forwarding address in the Google Mail account, or one that fulfills one of the following criteria: 1. It belongs to the same domain, 2. It belongs to a subdomain of the same domain, or 3. It belongs to a domain alias configured as part of the same Google Apps account. If the value of *forwardTo* doesn't adhere to one of these rules, setting up forwarding via the API will fail. Please refer to http://code.google.com/googleapps/domain/email_settings/developers_guide_protocol.html#GA_email_forwarding_mainfor more information. Regards, Brian Brian McNamara, Certified Google Apps Deployment Specialist LTech | [email protected] | 908-566-1728 | Google Voice 908-505-5155 On Thu, Feb 16, 2012 at 8:47 AM, Hugo <[email protected]> wrote: > Hello, > I am helping a university to use Google Apps for Education. > > The university would like to send email to students (e-mail domain of the > university), but wish it had a redirect if the student has another email. > > For example, I provide my information the university (including my e-mail) > and when the university to create the e-mail in Google Apps will add in > redirecting my email (which informed). > So I have two e-mail: [email protected] and [email protected] > When the university to send an email to [email protected], they want > to redicionar [email protected] > > I'm using the Google API. NET. The sample code is this: > > GoogleMailSettingsService GoogleMailSettingsService mail = new ("xxx", " > appsXXX"); > mail.setUserCredentials ("[email protected]", "y") / / email and password > Administrator > > mail.UpdateForwarding ("Hugo", "true", "[email protected]", "KEEP"); > > The following error occurs: > > <? xml version = "1.0" encoding = "UTF-8"?> > <AppsForYourDomainErrors> > <error errorCode="1303" invalidInput="[email protected]" > reason="EntityNameNotValid" /> > </ AppsForYourDomainErrors> > > I know that the student can enter the e-mail and do the redirection, but > the university wants to do this automatically. > How can I solve this problem? Does anyone have another suggestion? > > -- > You received this message because you are subscribed to the Google Groups > "Google Apps Domain Information and Management APIs" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-apps-mgmt-apis/-/RWpDLaRk1wMJ. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-apps-mgmt-apis?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.
