问题
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.
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.
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.
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?
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?
Thanks in advance
回答1:
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.
来源:https://stackoverflow.com/questions/28065192/how-to-send-an-email-in-c-sharp-with-gmail-template-signature