TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mark Tabor
548
2k
460.4k
SmtpClient.EnableSsl Property in asp.net
Jul 21 2016 6:52 AM
I have purchased a hosting with domain registration now i want to use my company mail account to send an email like
[email protected]
, below is my code
--------------------------------------------------------------------------------------------------------
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
Mail.From = New MailAddress("
[email protected]
")
Dim smtp As New SmtpClient("venus.hostingmadeeasy.com")
smtp.EnableSsl = true
smtp.Credentials = New System.Net.NetworkCredential("
[email protected]
", "pakistan")
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
Reply
Answers (
1
)
on my MVC webforms there is a text in the top of the form as
how to click on the insert button without updating the page