Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8548897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:36:15+00:00 2026-06-11T13:36:15+00:00

I need to send an email using tls how do i send it in

  • 0

I need to send an email using tls how do i send it in vb.net?
Heres my server information which i confirmed in thunderbird since it requires manual entry for my server:
1. smtp server: pod51004.outlook.com
2. port: 587
3. TLSSTART is connection security from what i remember

Im using live@edu email services for this scenario.
Heres my attempted code:

Class Mailer
        ''one static method for sending e-mails
        Shared Sub SendMail(ByVal [From] As String, ByVal [To] As String, _
                            ByVal Subject As String, ByVal Body As String, ByVal MailServer _
                            As String, Optional ByVal IsBodyHtml As Boolean = True, _
                            Optional ByVal MailPort As Integer = 25, _
                            Optional ByVal Attachments() As String = Nothing, Optional _
                            ByVal AuthUsername As String = Nothing, Optional ByVal _
                            AuthPassword As String = Nothing)

            'On Error GoTo ErrorHandler
            'create a SmtpClient object to allow applications to send 
            'e-mail by using the Simple Mail Transfer Protocol (SMTP).
            Dim MailClient As SmtpClient = New SmtpClient(MailServer, MailPort)
            MailClient.EnableSsl = True
            MailClient.DeliveryMethod = SmtpDeliveryMethod.Network
            'MailClient.UseDefaultCredentials = False
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
            Dim nc As NetworkCredential = New NetworkCredential(AuthUsername, AuthPassword)
            ''create a MailMessage object to represent an e-mail message
            ''that can be sent using the SmtpClient class
            Dim MailMessage = New MailMessage( _
            [From], [To], Subject, Body)
            ''sets a value indicating whether the mail message body is in Html.
            MailMessage.IsBodyHtml = IsBodyHtml
            ''sets the credentials used to authenticate the sender
            If (AuthUsername IsNot Nothing) AndAlso (AuthPassword _
                                                     IsNot Nothing) Then
                MailClient.Credentials = nc


            End If
            Dim 
            ''add the files as the attachments for the mailmessage object
            If (Attachments IsNot Nothing) Then
                For Each FileName In Attachments
                    MailMessage.Attachments.Add( _
                    New Attachment(FileName))
                Next
            End If
            MailClient.Send(MailMessage)
            ''ErrorHandler:
            '' MsgBox("My error")
        End Sub
    End Class

Anyone im up for ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:36:16+00:00Added an answer on June 11, 2026 at 1:36 pm

    Sorry to confuse answerers, but getting down to the general error It was giving was access denied. It turns out this is due to mcafee blocking the connection, thinking it was a worm trying to mass send emails (lol). But thanks for the help. P.S. remember to check mcafee in future cases of similar problems. Its a pain to get automated emails to work with mcafee.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For educational purposes, I need to send an email through an SMTP server, using
Since I need to send email by code, I'm currently using plan text but
I'm using asp.net with vb.net.. I need to send an email to my website
I need to send an email using Javamail and TLS (not STARTTLS, but a
I need to send email notifications in my Java web application. I'm using Apache
I need to send an email: to an arbitrary email address using an email
I am trying to send email using mail() in php. I need the message
When you send an email using System.Net.Mail you can set the SMTP MAIL FROM
I need to send html email. So I am using PEAR library with Mail
i have a situation where i need to send an email with attachment using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.