Solved

VB.Net, Symantec and  SMTP e-mail

Posted on 2006-12-01
3
442 Views
Last Modified: 2012-05-05
We are sending e-mail within a vb app.  But symantec blocks the e-mail until the program exits, which really is a pain.  

We worked around the problem by disabeling the "Internet E-Mail auto-protect".  With that disabled, the  mail goes out immediately, otherwise, they are held in "limbo" until the program ends and then any e-mails sent are finally passed on.

Here's the code I'm using:
 Dim stringFrom As String = ""
        ToEMail = mydata.GetOfficerEMail(Convert.ToInt32(OfficerComboBox.SelectedValue))

        EMailBody = New StringBuilder
        EMailBody.Append("Call Back request from: ")
        EMailBody.Append(CallerFirstNameTextBox.Text & " " & CallerLastNameTextBox.Text & vbCrLf)
        EMailBody.Append(CallerPhoneNumberTextBox.Text & vbCrLf & vbCrLf)
        If NotationTextBox.Text.Trim = "" Then
            'TRY TO get the last notation available.  If none, then just send the request.
            EMailBody.Append(vbCrLf & vbCrLf & "********* No Notation Entered********" & vbCrLf)
        Else
            'there is text in the notation, send it.
            EMailBody.Append(vbCrLf & vbCrLf & NotationTextBox.Text & vbCrLf)
        End If

       
        System.Windows.Forms.TextBox.CheckForIllegalCrossThreadCalls = False
        System.Windows.Forms.CheckBox.CheckForIllegalCrossThreadCalls = False
        System.Windows.Forms.ListBox.CheckForIllegalCrossThreadCalls = False

        Dim t As New Thread(AddressOf MailThread)

        t.Start()


    End Sub

    Private Sub MailThread()



        Dim mailMessage As New MailMessage(New MailAddress("TrustCallCenter@pioneertrustbank.com"), New MailAddress(ToEMail & "@pioneertrustbank.com"))
        With mailMessage
            .BodyEncoding = System.Text.Encoding.Default
            .Subject = "Call Center Callback Request"

            .Body = EMailBody.ToString
            .Priority = MailPriority.High
            .IsBodyHtml = False

            'Dim smptpermission As New SmtpPermission(Security.Permissions.PermissionState.Unrestricted)
            'smptpermission.Assert()

            Dim smtpMail As New SmtpClient
            smtpMail.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network

            smtpMail.Host = "mail.ptbna.com"
            smtpMail.Send(mailMessage)

            mailMessage = Nothing
            smtpMail = Nothing

        End With

    End Sub

I put it into a thread, hoping the closing of the thread would release the mail, but that didn't make any difference.  I really need to remove that code.

Also tried sendAsync, but no difference.

Help, don't like leaving symantec disabled, and have been unable to find a solution to this problem on-line.  found one person with the same problem, and their solution un-install Symanted anti-virus.

Chuck
0
Comment
Question by:PTBNA
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
hclgroup earned 500 total points
ID: 18055774
Not sure if you saw this already
http://channel9.msdn.com/ShowPost.aspx?PostID=204390
0
 

Author Comment

by:PTBNA
ID: 18055800
Nope hadn't see that.  We are running corporate version of symantec, and may not have that option available.  so far its working, and was hoping that there was a fix withing VB.

thanks,  I'll give you the points in a day or so if no one has a better answer.

chuck
0
 

Author Comment

by:PTBNA
ID: 18078373
Well, no on has come up with a better answer, it looks like disabeling Symantec Internet Mail filtering is the only solution.  

really wish there was a better answer, so I'm going to accept hclgroup's answer.
Chuck
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now