谷歌电子邮件设置api作为别名发送

时间:2015-06-16 20:51:53

标签: google-admin-sdk google-email-settings-api

尝试使用C#的电子邮件设置API创建sendas别名时出错。这是我的代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Google.GData.Apps;
using Google.GData.Apps.GoogleMailSettings;
using Google.GData.Client;
using Google.GData.Extensions;


namespace EmailSettings
{
    class Program
    {
        static void Main(string[] args)
        {
            GoogleMailSettingsService service = new GoogleMailSettingsService("domain.com", "apps");
            service.setUserCredentials("administrator@domain.com", "pwd");

            service.CreateSendAs("username", "FriendlyAlias", "testalias@domain.com", "", "true");
        }
    }
}

我收到以下错误" {"执行请求失败:https://apps-apis.google.com/a/feeds/emailsettings/2.0/domain.com/username/sendas"}"

内部异常是{"远程服务器返回错误:(400)错误请求。"}

0 个答案:

没有答案