通过SMTP发送邮件 [英] Sending Mail via SMTP

查看:294
本文介绍了通过SMTP发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿小组,


有没有人能指出我正确的方向,如何从VB发送电子邮件?b
发送电子邮件?


基本上想要一个3 x文本框的表单,1表示From,1表示主题,1

表示消息。


非常感谢

MCN

解决方案



< a rel =nofollowhref =http://support.microsoft.com/default.aspx?scid=kb;en-us;313773target =_ blank> http://support.microsoft.com/default ... b; en-us; 313773


Ken

--------------

" MadCrazyNewbie" < TE ** @ nospam.com>在消息中写道

新闻:我们******************** @ karoo.co.uk ...

嘿小组,

任何人都可以指出我正确的方向,如何从VB发送电子邮件?

基本上想要一个包含3个文本框的表单,1个用于From,1个用于主题,
1
用于消息。

非常感谢
MCN



*" MadCrazyNewbie" < TE ** @ nospam.com> scripsit:

有没有人能指出我正确的方向如何从VB发送电子邮件?

基本上想要一个表格带3个文本框的1个用于From,1个用于主题,1个用于消息。




我的常见问题解答:


命名空间''System.Web.Mail''(需要引用System.Web.dll),

FAQ:< URL:http:// www。 systemwebmail.net/> ;.


CDO / Exchange:


使用.NET Framework应用程序的Microsoft Exchange API支持策略

< URL:http://support.microsoft.com/?scid = kb; EN-US; 813349>


如何:使用CDOEX和ADO检索邮件在Visual C#

< URL:http://support.microsoft.com/?scid = kb; EN-US; 310206>


Self- :
< URL:http://www.codeproject.com/csharp/karavaev_denis.asp>

< URL:http:// www.codeproject.com/csharp/popapp.asp>

< URL:http://www.codeproject.com/csharp/pop3client.asp>


SMTP和POP3邮件服务器

< ;网址:http://www.codeproject.com/csharp/smtppop3mailserver.asp>


商业:


< URL:http ://www.abderaware.com/mail/>


-

Herfried K. Wagner [MVP]

< URL:http://dotnet.mvps.org/>


您好


这将帮助您入门:


位于项目顶部

进口System.Web.Mail


然后代码背后的例子一个按钮


尝试

SmtpMail.SmtpServer =" XXX.XXX.XXX.XXX" smtp服务器的IP

Dim消息作为MailMessage

消息=新MailMessage()

Message.From = txtFrom.text

Message.To = txtTo.Text

Message.Cc = txtcc.Text

Message.Subject = txtSubject.Text

留言.Body = txtMail.Text

Message.BodyFormat = MailFormat.Text

SmtpMail.Send(Message)

catch ex as exception

msgbox(ex.tostring)

结束尝试


您还可以附加文件,但目前我还没有时间

给你那个代码,但是找你自己也不会伤到你。


HTH

Gr Peter


" MadCrazyNewbie" < TE ** @ nospam.com>在消息新闻中写道:<我们******************** @ karoo.co.uk> ...

嘿小组,

任何人都可以指出我正确的方向,如何从VB发送电子邮件?

基本上想要一个3 x的表格文本框的1对于From,1对于主题,1对于消息。

非常感谢
MCN



Hey group,

Could anybody point me in the right direction for some hows to`s on how to
send e-mail from VB?

Basically want a form with 3 x textbox''s on 1 for From, 1 for subject, and 1
for message.

Many Thanks
MCN

解决方案

Hi,

http://support.microsoft.com/default...b;en-us;313773

Ken
--------------
"MadCrazyNewbie" <te**@nospam.com> wrote in message
news:We********************@karoo.co.uk...

Hey group,

Could anybody point me in the right direction for some hows to`s on how to
send e-mail from VB?

Basically want a form with 3 x textbox''s on 1 for From, 1 for subject, and
1
for message.

Many Thanks
MCN



* "MadCrazyNewbie" <te**@nospam.com> scripsit:

Could anybody point me in the right direction for some hows to`s on how to
send e-mail from VB?

Basically want a form with 3 x textbox''s on 1 for From, 1 for subject, and 1
for message.



My FAQ:

Namespace ''System.Web.Mail'' (requires reference to "System.Web.dll"),
FAQ: <URL:http://www.systemwebmail.net/>.

CDO/Exchange:

Support Policy for Microsoft Exchange APIs with .NET Framework Applications
<URL:http://support.microsoft.com/?scid=kb;EN-US;813349>

HOW TO: Retrieve Messages Using CDOEX and ADO in Visual C#
<URL:http://support.microsoft.com/?scid=kb;EN-US;310206>

Self-made:

<URL:http://www.codeproject.com/csharp/karavaev_denis.asp>
<URL:http://www.codeproject.com/csharp/popapp.asp>
<URL:http://www.codeproject.com/csharp/pop3client.asp>

SMTP and POP3 Mail Server
<URL:http://www.codeproject.com/csharp/smtppop3mailserver.asp>

Commercial:

<URL:http://www.abderaware.com/mail/>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Hi

this will get you started:

at the top of your project
Imports System.Web.Mail

then the code behind for example a button

try
SmtpMail.SmtpServer = "XXX.XXX.XXX.XXX" IP of an smtp server
Dim Message As MailMessage
Message = New MailMessage()
Message.From = txtFrom.text
Message.To = txtTo.Text
Message.Cc = txtcc.Text
Message.Subject = txtSubject.Text
Message.Body = txtMail.Text
Message.BodyFormat = MailFormat.Text
SmtpMail.Send(Message)
catch ex as exception
msgbox(ex.tostring)
end try

You can also attacht files but for the moment I haven''t got time to
give you that code, but looking for that yourself won''t hurt you.

HTH
Gr Peter

"MadCrazyNewbie" <te**@nospam.com> wrote in message news:<We********************@karoo.co.uk>...

Hey group,

Could anybody point me in the right direction for some hows to`s on how to
send e-mail from VB?

Basically want a form with 3 x textbox''s on 1 for From, 1 for subject, and 1
for message.

Many Thanks
MCN



这篇关于通过SMTP发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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