Private Sub btnSend_Click()Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim aMessage As New MailMessage
aMessage.From = Trim(txtEmail.Text)
aMessage.To = Trim(txtFEmail.Text)
aMessage.Subject = "您的朋友" & txtName.Text & "给您推荐了一家企业信息(HeNanYellowPage)"
aMessage.Body = txtDetail.Text
aMessage.BodyFormat = MailFormat.Html
SmtpMail.SmtpServer = ""
SmtpMail.Send(aMessage)
Response.Write("您好,您的推荐信已经发出去了")
End Sub
我试了很多次没有发出去。
网上写了很多的类似代码,我觉得发出去才怪。
有的都没有写这行SmtpMail.SmtpServer = ""
记得以前做过类似的Windows的程序,配置OutLook后可以发送,
这次也配置了,不知这么就是不行。