使用.NET在Gmail中保存电子邮件作为草稿 [英] Save Email As Draft in Gmail Using .NET

查看:134
本文介绍了使用.NET在Gmail中保存电子邮件作为草稿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个vb.net应用程序。目前我正在使用此应用程序向客户发送邮件。



发送邮件我正在使用以下功能(示例函数语法):



I have a vb.net application.Currently I am sending mails to the customer using this Application.

To send the mail I am using following Function (Sample Function syntax):

objSmtpClient = New SmtpClient("smtp.gmail.com")
            objSmtpClient.Credentials = New Net.NetworkCredential("abc@gmail.com", "XYZ")
            objSmtpClient.EnableSsl = True
            objSmtpClient.Timeout = 1234657890
                       objSmtpClient.Port = 123
            objMailMessage = New System.Net.Mail.MailMessage()
            objMailMessage.From = New MailAddress("abc@gmail.com")
            objMailMessage.Subject = HttpUtility.HtmlDecode(StrSubject.ToString().Trim())

            objMailMessage.IsBodyHtml = True
            objMailMessage.Bcc.Add(New MailAddress("cba@gmail.com"))
            objMailMessage.To.Add(txtbxEmail.Text.ToLower)
            StrBody = dt.Rows(0)("vEmailTemplate").ToString
            replaceDrpValues(StrBody, SerialKey)
            objMailMessage.Body = StrBody
            objSmtpClient.Send(objMailMessage)







使用此功能我可以将邮件发送到To字段中的任何电子邮件ID。



现在需求已更改我不想直接从邮件发送邮件Application.I想要将电子邮件作为草稿保存在GMAIL中的FROM电子邮件ID中。我手动想要登录Gmail帐户然后发送草稿。



我想在Web和窗口应用程序中实现此功能。



帮助我Plz。





急切等待你的回复。





谢谢。




Using This function I am able to send the Mail to any Email ID which is in To field.

Now the Requirement changed I don't want to Send the Mail directly from the Application.I want to save the Email as a Draft in the FROM Email Id in GMAIL.I manually Want to login to the Gmail account and then send the draft.

I want to achieve this functionality in both Web And window application.

Help Me Plz.


Awaiting for your responses eagerly.


Thank You.

推荐答案

这是一个人用Java提出的解决方案,你可以看看代码并将它移植到它上面你正在使用的东西;



http://stackoverflow.com/questions/5355067/programatically-save- draft-in-gmail-drafts-folder [ ^ ]
Here is a solution someone came up with in Java, you could take a look at the code and port it across it what you are using;

http://stackoverflow.com/questions/5355067/programatically-save-draft-in-gmail-drafts-folder[^]


这篇关于使用.NET在Gmail中保存电子邮件作为草稿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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