Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
Private Function SendEmail(ByVal strTo As String, ByVal strSubject As String, ByVal strBody As String, ByVal strAttachment As String, ByVal strFrom As String, Optional ByVal CCTo As String = "") As Boolean ' Take the parameters passed in the function and create an email message Dim oMessage As MailMessage = New MailMessage(strFrom, strTo, strSubject, strBody) oMessage.IsBodyHtml = False ' Does the message have a cc address? If CCTo <> "" Then oMessage.CC.Add(CCTo) End If ' Does the message have an attachment? Dim oAttachment As Attachment = Nothing If strAttachment <> "" Then oAttachment = New Attachment(strAttachment) oMessage.Attachments.Add(oAttachment) End If Try Dim oClient As New SmtpClient(My.Settings.SMTPServer, My.Settings.PortNumber) Debug.Print(oMessage.Body) oClient.Send(oMessage) ' Release the attachment if it exists If oAttachment IsNot Nothing Then oAttachment.Dispose() oAttachment = Nothing End If ' Email sent successfully Return True Catch ex As System.Net.WebException ' Email Failed Console.WriteLine("0", ex.Message) Console.Write("0", ex.ToString()) Return False End Try End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Cannot kill Excel from taskmgr after Excel Export in VB 2014||6||37|
|URL to post Gmail webmail issues||2||73|
|return value based on substr||10||51|
|How to set focus on a dynamic control||18||26|