Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
Again Email sending error
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
ToBe
10y
913
1
Reply
Hi every one
I have one application have multiple users I need to send them an email using my exchange server "dtreExhcange server" this is my code
Sub SendSimpleMail(ByVal toEmailAddress As String)
'======================================
Dim mail As New MailMessage()
Dim msgBody As String
Dim smtp As New SmtpClient
mail.From = New MailAddress("
[email protected]
")
msgBody = txtEmailBody.Text
mail.To.Add(toEmailAddress)
mail.Subject = Subject.Text
mail.Body = msgBody
mail.IsBodyHtml = True
smtp.Host = "dtreExhcange.dt.org"
smtp.Port = 25
smtp.EnableSsl = True
smtp.Credentials = New System.Net.NetworkCredential("
[email protected]
", "123")
Try
smtp.Send(mail)
mail.Attachments.Dispose()
MsgBox("Thank You your Message has been sent.")
Catch x As Exception
If x.Message.ToString = "Failure sending mail." Then
MsgBox("Please check your Internet Connection and try again", MsgBoxStyle.Information)
Else
MsgBox("Failed to Send", MsgBoxStyle.Exclamation)
End If
End Try
End Sub
but it's not working it will not connect to the exchange server.
it will always give this error :
"Please check your Internet Connection and try again
I changed the port no but still not working .
HELP !!!
can you help me on that .
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Conversion from type 'DBNull' to type 'String' is not valid
About ODIN?