我正在尝试通过代码发送电子邮件,但遇到了障碍。我当时正在工作this当 Base64UrlEncode 显示为红色时。我的代码中有相同的 using 语句。
using System;
using System.IO;
using System.Net.Mail;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MyCompany.Sample.EmailConnector.Model;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Gmail.v1;
using Google.Apis.Gmail.v1.Data;
using Google.Apis.Services;
using Google.Apis.Util.Store;
...
public static Message createGmailMessage(AE.Net.Mail.MailMessage mailMessage)
{
var messageString = new StringWriter();
mailMessage.Save(messageString);
Message gmailMessage = new Message();
gmailMessage.Raw = Base64UrlEncode(messageString.ToString());
}