locked
email hosting platform having troubles RRS feed

  • Question

  • After much hard work i got a lock on a specific port of a gmail standard account at a certain setting to send an attached file through my program. But very recently, by some strange un-known reason, those emails have been getting problems, the specific error being jumped by the published program has looked like this


    "Unhanded exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue, if you click Quite, the application will close immediately.


    Server does not support secure connections"

    the "Server does not support secure connections" also appeared in the debugging window, so i click on details, in the application interface.

    "See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.Net.Mail.SmtpException: Server does not support secure connections.
       at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
       at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
       at System.Net.Mail.SmtpClient.GetConnection()
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at Study_Guide.FrmAssignments.Button2_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    Study Guide
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Documents%20and%20Settings/Radical%20Areal%20Acer/Desktop/My%20Programs/Study%20Guide.exe
    ----------------------------------------
    Microsoft.VisualBasic
        Assembly Version: 8.0.0.0
        Win32 Version: 8.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Runtime.Remoting
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.1378 (REDBITSB2.050727-1300)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box."


    not that i understand a whole lot about what all of this information means, if it is any help to anyone, i feel obliged to post, as far as when it comes to the system code that 2008 vb has referenced.


    while i now know better than to expect an obvious answer i was wondering if i could be given a general heads up as to where the problem may reside. Although i've been using the same computer with the same code, i have recently had a new anti-virus software installed on it, i have no clue however, if this is culprit and it does not appear to be likely.

    if there is a problem that has recently changed with the gmail server than fine, if anyone should just happen to know about it, be sure to let me know, i may end up getting a new provider for the email service anyways, if that doesn't solve the problem than that leads me to believe there may be a flaw in my code, however the process of networking is so conspicuous, that i don't fully expect anyone to see much, if they can than great! be sure to let me know!


    finally, maybe there's just a better approach all together?

    As a final remark i'll post the code i'm using with some minor adjustments for security measures that are simple, but will not likely remain for much longer anyways, but just as a last not:

    Code Block

    Dim a As String = ""
            Dim b As String = ""
            Dim c As String = ""
            Dim D As String = ""
            Dim z As String = ""
            Dim j As String = ""
            Dim y As String = ""
            Dim t As String
            If Listbox1.Text = "" Then
                MessageBox.Show("Please select an report to send")
                Exit Sub
            End If
            t = MessageBox.Show("You have two methods for emailing an assignment, select ok to coninue the process and send a default email, or click cancel and retrieve the file path which you can then copy and paste into your attachments.", "Email Method", MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
            If t = vbCancel Then
                MessageBox.Show("C:\Program Files\StudyGuide\" & FrmClass.Tag & "\" & FrmSubject.Tag & "\" & Me.Tag & "\Assignments\" & LbxHomework.Text & " Has now been copied to your clipboard")
                Clipboard.SetText("C:\Program Files\StudyGuide\" & FrmClass.Tag & "\" & FrmSubject.Tag & "\" & Me.Tag & "\Assignments\" & LbxHomework.Text)
            End If
            If t = vbOK Then
                a = InputBox("Write in the adress to which you wish to deliver this report, separate by ';'", "Step 1")
                If a <> "" Then
                    b = InputBox("Write a Subject Line", "Step 2")
                    c = InputBox("Write a Message", "Step 3")
                    D = InputBox("Sign Your Name:", "Step 4")
                    If D = "" Then
                        Do Until D <> "" Or z = vbYes
                            z = MessageBox.Show("Email must be signed. Cancel Email?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                            If z = vbYes Then
                                Exit Sub
                            End If
                        Loop
                    End If
                    j = InputBox("Write in your email address", "Step 5")
                    If j = "" Then
                        Do Until j <> "" Or y = vbYes
                            y = MessageBox.Show("From Email Required. Cancel Email?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                            If y = vbYes Then
                                Exit Sub
                            End If
                        Loop
                    End If
                    If b = "" Then
                        b = "(No Subject)"
                    End If
                End If
                If a = "" Then
                    Exit Sub
                End If
                Dim stringset As String
                stringset = c + Constants.vbLf + D + Constants.vbLf + j + Constants.vbLf + IO.File.ReadAllText("C:\Program Files\StudyGuide\TextFile1.txt")
                Dim email As New System.Net.Mail.MailMessage()
                For Each sec As String In a.Split(";")
                    email.To.Add(New Net.Mail.MailAddress(sec))
                Next
                email.From = New Net.Mail.MailAddress("x@gmail.com")
                email.Subject = b
                email.Body = stringset
                For Each sel As String In Listbox1.SelectedItems()
                    email.Attachments.Add(New System.Net.Mail.Attachment("C:\Program Files\StudyGuide\" & FrmClass.Tag & "\" & FrmSubject.Tag & "\" & Me.Tag & "\Reports\" & sel))
                Next
                email.DeliveryNotificationOptions = Net.Mail.DeliveryNotificationOptions.OnFailure Or Net.Mail.DeliveryNotificationOptions.Delay
                Dim client As New Net.Mail.SmtpClient("smtp.gmail.com", 25)
                client.Credentials = New System.Net.NetworkCredential("x@gmail.com", "x")
                client.EnableSsl = True
                client.Send(email)
            End If


    Well there you go, as i've said i don't expect right away answers, but if there are some possibilities that could be considered as a need for a heads up, that's the kind of answer i'm expecting and anxiously awaiting. If there is a direct answer, it would however be nice, please let me know if you have one.
    Tuesday, January 1, 2008 6:01 AM

Answers