标题:[求助]电子邮件功能不能实现,please help!!
只看楼主
summer1983
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-5-16
 问题点数:0 回复次数:0 
[求助]电子邮件功能不能实现,please help!!

电子邮件的发送问题 我对.net不是很熟,照着参考书把程序打上去了,实现不了功能。对IIS中的SMTP进行了简单的设置,设置了SMTP虚拟服务器。 代码如下: Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click Dim mail As MailMessage = New MailMessage mail.To = mailTo.Text mail.From = mailFrom.Text mail.Subject = mailSubject.Text mail.Body = mailBody.Text If Format.SelectedItem.Text = "纯文本格式" Then mail.BodyFormat = MailFormat.Text Else mail.BodyFormat = MailFormat.Html End If Dim file As HttpPostedFile = FileUp.postedFile If file.ContentLength <> 0 Then Dim FileSplit() As String = Split(file.FileName, "\") Dim FileName As String = FileSplit(FileSplit.Length - 1) file.SaveAs(Server.MapPath(FileName)) Dim attach As New MailAttachment(Server.MapPath(FileName)) mail.Attachments.Add(attach) End If

On Error Resume Next SmtpMail.SmtpServer = "msa.hinet.net" 这点我不懂是什么意思,请不吝赐教!! SmtpMail.Send(mail)

If Err.Number Then Label1.Text = Err.Description Else Label1.Text = "邮件已发出!" End If End Sub End Class 多谢多谢!!!!!!!!!!!

搜索更多相关主题的帖子: help please 电子邮件 
2005-05-16 23:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-18423-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.513076 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved