为什么邮件发不出去??????
请高手指点!!!
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mymessage As New MailMessage
Dim i As Integer
Dim attchments(fj.Items.Count) As String
Dim attchfile As MailAttachment
mymessage.From = femail.Text
mymessage.To = txtshou.Text
mymessage.Subject = txtsub.Text
mymessage.Body = txtemail.Text
mymessage.BodyFormat = MailFormat.Html
attchfile = New MailAttachment(upfile.PostedFile.FileName)
mymessage.Attachments.Add(attchfile)
For i = 0 To fj.Items.Count - 1
attchments(i) = fj.Items(i).Value
Next
SmtpMail.SmtpServer = "smtp.163.com"
SmtpMail.Send(mymessage)
Label7.Text = "你的信件已经成功的发送到了" + txtshou.Text
Page.RegisterClientScriptBlock("ok", "<script language=javascript>alert('发送成功')</script>")
End Sub