--------------------------------------------------------------------------------------------------------
Private Sub SendEmail()
'These twos are commented on Morning on 2/5/2014
GetUserIDEmail(Session("LoggedInUserId"))
' GetEmailAddressOfReporintUser(Hdm.Value)
' Using mailMessage As New MailMessage()
Dim Mail As New MailMessage
Try
Mail.IsBodyHtml = True
Dim MailText As String = Nothing
Mail.Subject = " Report Submitted By : " & Session("LoggedInUserFullName") & " " & "User Type:" & GetUserTypeName(CInt(Session("UserTypes")))
MailText = MailText + "<font face='verdana' color='#000000'>" & "Dear User, " & "</font><br/>
Mail.IsBodyHtml = True
Mail.Body = MailText
Dim files As List(Of HttpPostedFile) = DirectCast(Cache(Me.Key), List(Of HttpPostedFile))
For Each file As HttpPostedFile In files
Mail.Attachments.Add(New Attachment(file.InputStream, Path.GetFileName(file.FileName), file.ContentType))
Next
Dim smtp As New SmtpClient("venus.hostingmadeeasy.com")
smtp.EnableSsl = true
smtp.Port = 25
Catch ex As Exception
ex.Message.ToString()
End Try
End Sub
My code run ok when i made smtp.Enab,eSsl=false but when i select it to true it gives an error as mentioned below
server does not support secure connections. smtp exception