日期:2014-05-18  浏览次数:20366 次

送分拉!小问题,帮我试下就好啦
VB.NET code

 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        SendMail("fachyou@sina.com", "fachyou@126.com", Nothing, "ssss", "sssssssssssssssssssssss")
    End Sub
    Public Shared Sub SendMail(ByVal sender As String, ByVal receiver As String, ByVal cc() As String, ByVal subject As String, ByVal content As String)
        '   siteConfigModel = bSiteConfig.GetModel()
        Try
            Dim mail As MailMessage = New MailMessage(sender, receiver)
            Dim smtp As SmtpClient = New SmtpClient("smtp.sina.com")
            Dim nc As NetworkCredential = New NetworkCredential("fachyou@sina.com", "87654321")
            mail.Subject = subject
            mail.Body = content
            If Not (cc Is Nothing) Then
                If (cc.Length > 0) Then
                    Dim item As String
                    For Each item In cc
                        mail.CC.Add(item)
                    Next
                End If
            End If
            mail.IsBodyHtml = True
            smtp.Credentials = nc
            smtp.Send(mail)
        Catch ex As SmtpFailedRecipientException
            Throw New Exception(ex.Message)
        End Try
    End Sub


这段代码发邮件!不知道是我代码问题还是smtp服务器问题,发不出去啊!哪为高手帮我看看

------解决方案--------------------
smtp服务器问题
------解决方案--------------------
up,vb的啊?