在Windows应用程序中从文本框发送电子邮件 [英] send an email from textbox in windows application program

查看:125
本文介绍了在Windows应用程序中从文本框发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我的兄弟..
我正在(Windows

应用C#)和该程序到

发送电子邮件到我的帐户.在此

程序中,我将三个工具以
的形式
:
拖曳文本框和一个按钮.
我应该输入消息的对象

在textbox1中,然后在
中键入消息
textbox2,当我点击

(发送)按钮,程序将发送

此消息发送到我的电子邮件.
示例:
我输入了textbox1:Hello
在textbox2中:(我想要的消息)
最后:
我应该在按钮中键入的代码是什么,请解释代码.

谢谢大家.

Hello my brother..
I am designing a program in(windows

application C# )and this program to

send an email to my account.In this

program I put three tools in the form

:
Tow Textbox and one Button .
I should type object of the message

in textbox1,and type the message in

textbox2 and when I click on the

(send)button ,the program will send

this message to my email.
Example:
I typed in textbox1: Hello
in textbox2:(the message that I want)
Finally:
what is the code that I should type it in the button and please explain the code.

Thank you all.

推荐答案

Sonny,无论您键入按钮"中的任何代码都无济于事.按钮不需要编码.它已经创建.

您需要使用以下命令: http://msdn.microsoft.com/en-us/library/system.net.mail.aspx [ ^ ].

另请参见:
http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system. net.mail.smtpclient.aspx [ ^ ](请参阅最后的示例),
http://forums.asp.net/t/971802.aspx [
Sonny, whatever code you "type in the button" it won''t help you. A button does not need coded; it is already created.

You need to use this: http://msdn.microsoft.com/en-us/library/system.net.mail.aspx[^].

See also:
http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx[^] (see a sample at the end),
http://forums.asp.net/t/971802.aspx[^],

You will be able to find a lot more if you Google.

—SA


这篇关于在Windows应用程序中从文本框发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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