GMAIL API使用C#发送带有附件的电子邮件 [英] GMAIL API sending email with attachment in c#

查看:141
本文介绍了GMAIL API使用C#发送带有附件的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用c#中的Gmail Api发送带有附件的电子邮件时,我需要帮助.

I need help with sending email w/attachment using Gmail Api in c#.

我已经阅读了有关发送带有附件的电子邮件的Google网站,但是该示例在Java中.

I have read Google website on sending emails with attachment but the example is in java.

推荐答案

使用Gmail API发送附件没有什么特别的.无论哪种方式,Gmail API message.send()都会在message.raw字段(采用urlsafe base64编码)中获取完整的RFC822电子邮件.主要技巧是使用您的语言构建这样的RFC822电子邮件消息字符串.我想象C#中有一些MIME消息库,而主要的问题是找到这些库.我不使用C#,但是javax.internet.mail.MimeMessage在Java中效果很好,而电子邮件"模块对python很有用.

There's nothing particular to sending an attachment with the Gmail API. Either way the Gmail API message.send() takes a full RFC822 email message in the message.raw field (urlsafe base64 encoded). The main trick is building up such an RFC822 email message string in your language. I imagine there are some MIME message librarys in C# and that's the main issue is finding those libraries. I don't do C# but javax.internet.mail.MimeMessage works well in java and the 'email' module is good for python.

这另一则帖子似乎与之相关: 如何在c#中发送多部分MIME消息?

This other post seems relevant: How to send multi-part MIME messages in c#?

这篇关于GMAIL API使用C#发送带有附件的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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