CODE
Public Function sendMail() As Boolean
Try
‘_strFrom= “x@ycoderscookbook.com”
‘_strTo= “y@ycoderscookbook.com”
Dim mail As New MailMessage(_strFrom, _strTo)
mail.Subject = _strSubject
mail.Body = _strBody
Dim SmtpMail As New SmtpClient
SmtpMail.Host = "ycoderscookbook.com"
SmtpMail.Send(mail)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
Try
‘_strFrom= “x@ycoderscookbook.com”
‘_strTo= “y@ycoderscookbook.com”
Dim mail As New MailMessage(_strFrom, _strTo)
mail.Subject = _strSubject
mail.Body = _strBody
Dim SmtpMail As New SmtpClient
SmtpMail.Host = "ycoderscookbook.com"
SmtpMail.Send(mail)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
I get an exception thrown (Unable to read data from the transport connection: net_io_connectionclosed). When sniffing the packets, the request is made but no reply is ever received. I’m guessing that Astahost has done something to block this behavior (prevent SPAM) and that’s why no communication is happening.
Any ideas on the mail issue or perhaps a better way to send program notifications?

