大家好,又见面了,我是你们的朋友全栈君。

System.Net.WebProxy proxy
=
new
System.Net.WebProxy(
“
itgproxy.redmond.corp.microsoft.com:80
“
);

=
System.Net.CredentialCache.DefaultCredentials;

=
proxy;

=
new
MailMessage();

=
tbFrom.Text;

=
tbTo.Text;

=
tbSubject.Text;

=
tbBody.Text;

//
优先级

switch
(ddlp.SelectedIndex)


…
{











//
格式

if
(ddlp.SelectedIndex
==
0
)

=
MailFormat.Text;

else

=
MailFormat.Html;

//
以下设置服务器

if
(tbServer.Text
!=
“”
)


…
{











//
以下处理附件

string
strFileName
=
FileSelect.PostedFile.FileName;

if
(strFileName
!=
“”
)

new
MailAttachment(strFileName));

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/151995.html原文链接:https://javaforall.net