【问题标题】:Is it possible to send email from Google Apps from a Nickname in C#是否可以通过 C# 中的昵称从 Google Apps 发送电子邮件
【发布时间】:2013-01-15 01:27:40
【问题描述】:

我有一个标准的 Google Apps 帐户,他们为我托管我的电子邮件..

目前我可以用 C# 代码发送电子邮件,但它们总是来自我的主要电子邮件地址。我设置了几个昵称...在 Gmail 界面中,可能如下所述:Google Apps - Send email from a nickname

但我想从代码中做到这一点......所以我可以发送电子邮件为“info@”或“support@”...... 我有一个名为“EmailFrom”的 appSetting,它被定义为“info@”...

MailMessage mm = new MailMessage(ConfigurationManager.AppSettings["EmailFrom"], ToAddress);

//'(2) Assign the MailMessage's properties
mm.Subject = Subject;
mm.Body = MessageBody;
mm.IsBodyHtml = true;

//'(3) Create the SmtpClient object
SmtpClient smtp = new SmtpClient();

smtp.Port = System.Convert.ToInt32(ConfigurationManager.AppSettings["smtpPort"]);
smtp.EnableSsl = true;

smtp.Send(mm);

这可能吗?

【问题讨论】:

    标签: c# google-apps


    【解决方案1】:

    好的..

    想通了……

    看来我需要在gmail界面中添加电子邮件地址... 选择“设置”菜单,然后选择“帐户...”,然后选择“添加您拥有的另一个电子邮件地址”。 我刚刚完成了验证过程,添加了我想发送的昵称..

    简单..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-02
      • 2010-10-19
      • 2015-04-26
      • 1970-01-01
      • 2013-08-15
      • 1970-01-01
      • 2020-12-15
      相关资源
      最近更新 更多