如何使用gmail模板/签名在C#中发送电子邮件 [英] How to send an email in C# with gmail template/signature

查看:110
本文介绍了如何使用gmail模板/签名在C#中发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用System.Net.Mail库发送带有C#的电子邮件。我可以发送gmail,这是我想要的供应商。

I know how to send an email with C# using the System.Net.Mail library. I can send it with gmail, which is the provider I want.

然而,当我发送电子邮件时,不会添加好的Gmail签名/模板。我需要添加这个,因为它将是从应用程序发送的商业电子邮件,所以它需要看起来很专业。

Yet when I send an email the nice Gmail signature / template isn't added. I need this to be added because it will be business emails that will be send from the application, so it needs to look professional.

我已经尝试使用gmail API,但我无法发送电子邮件...几乎没有关于C#的Gmail API的教程或论坛,没有代码预览。

I have already tried to use the gmail API but I am not able to send an email with that... There are almost no tutorials or forums about Gmail API for C# and no code previews.

所以我需要以了解是否可以发送具有已在Gmail帐户上指定的签名的电子邮件。如果可以的话,我该怎么做?

So I need to know if it is possible to send an email with a signature that is already specified on the Gmail account. If this is possible, how can I do it?

如果你知道这是不可能的,但应该是使用Gmail API。你可以告诉我如何发送电子邮件吗?

If you know that this is not possible, but should be with the Gmail API. Could you tell me how to send an email with that?

提前感谢

推荐答案

您可以为您的电子邮件内容创建一个html页面。对于需要动态的电子邮件的内容,您可以使用令牌。喜欢在电子邮件中需要更改的名称,您可以在html中使用令牌,如Dear [Name]。在发送电子邮件之前,您需要找到html文件解析器(有很多的),并将令牌的值替换为您想要的。

You can create a html page for your email content. For content of the email that is need to be dynamic you can use tokens. Like for name in the email that needs to be changed you can use a token in the html like Dear [Name]. Before sending the email you need to find html file parser (there are plenty out there) and replace values of token to what you want them to be.

这篇关于如何使用gmail模板/签名在C#中发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆