在VB .NET中以编程方式使用Windows Live Mail [英] Using Windows Live Mail Programmatically in VB .NET

查看:78
本文介绍了在VB .NET中以编程方式使用Windows Live Mail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何在VB .NET中以编程方式使用Windows Live Mail发送电子邮件?



为什么要这样做?



我最近在尝试为此编写程序过去使用VB .NET。它要求我将消息格式化为HTML,这不是优雅的。我必须将Word文件粘贴到FrontPage中,然后将HTML选项卡中的文本复制到邮件表单上的文本框中。我需要做一些额外的编程,以确保所有收件人都能看到徽标。徽标的图像必须嵌入到消息中才能实现。这要求我以编程方式编辑HTML编码的消息,以将图像引用更改为嵌入的图像代码。是否容易以编程方式准确地编辑HTML文本。



我是唯一一个做邮件的人,我正在使用WLM来做这件事。使用专有软件不是问题。我手动将收件人地址复制到BCC中,以避免将其暴露给所有其他收件人。但是因为WLM不允许我只显示BCC字段,所以我可以在不知情的情况下将地址粘贴到CC字段中。我已经这样做了一次,并没有受到好评。如果我可以通过pragrammatically粘贴地址,我不会再犯这个错误,因为我会编写代码来更新BCC字段。



我们不想要将Word或富文本文档作为附件发送。消息必须在正文中,并且看起来像原始的Word文档。 WLM手动执行此操作没有问题。每个人都收到我们想看的消息。如果我可以使用VB .NET来确保我只使用BCC,它会使过程更准确并让所有收件人都满意。



我希望我提供所有问题的背景和更容易回答。



谢谢,



迈克

Hi,

How can I programmatically send email using Windows Live Mail from within VB .NET?

Why do want to do this?

I have tried writing a program for this in the recent past using VB .NET. It required me to format the message into HTML which was not elegant. I had to paste the Word file into FrontPage and then copy the text in the HTML tab into a text box on the message form. I needed to do some additional programming to ensure that the logo would be seen by all recipients. The image of the logo had to be embedded in the message to make this happen. This required me to programmatically edit the HTML coded message to change the image reference to the embedded image code. Is is not easy to programmitically edit HTML text accurately.

I am the only one doing the mailing and I'm using WLM to do it. Using proprietary software is just not an issue here. I copy the recipient addresses into the BCC manually to avoid exposing them to all the other recipients. But because WLM doesn't let me show only the BCC field, I can paste the addresses into the CC field by mistake without knowing it. I already did this once and it was not well received. If I can pragrammatically paste in the addresses, I would not make this mistake again, because I would write the code to update only the BCC field.

We do not want to send a Word or rich text doc as an attachment. The message has to be in the body and look like the original Word doc too. WLM has no problem doing this manually. Everyone receives the message looking like we want to look. If I can use VB .NET to ensure I use only the BCC, it would make the process more accurate and keep all the recipients happy.

I hope I have provided all the background to my question and made easier to answer.

Thanks,

Mike

推荐答案

我觉得它根本没有任何意义。这不是尝试使用常规用户的方法而不是程序员的方法吗?直接发送邮件的次数要简单数百万次。



请参阅我最近的回答:在.NET中使用Windows Live Mail [ ^ ]。(此链接已经消失;谢谢理查德。)



如果从这里开始,你会找到所需的一切:

http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx [ ^ ],

http://msdn.microsoft.com/en-us/ library / system.net.mail.smtpclient.aspx [ ^ ],

http://msdn.microsoft.com/en-us /library/microsoft.exchange.data.transport.smtpserver%28v=exchg.150%29.aspx [ ^ ]。



-SA
I don't think it may make any sense at all. Isn't it an attempt to use regular user's approach instead of programmer's? Direct sending of mail is millions times simpler and more robust.

Please see my recent answer: Using Windows Live Mail in .NET[^]. (This link is already gone; thank you, Richard.)

You will find all you need if you start from here:
http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx[^],
http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.transport.smtpserver%28v=exchg.150%29.aspx[^].

—SA


这篇关于在VB .NET中以编程方式使用Windows Live Mail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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