Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GMail blues
Message
From
12/04/2013 13:31:02
 
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows NT
Database:
Jet/Access Engine
Application:
Desktop
Miscellaneous
Thread ID:
01570810
Message ID:
01570816
Views:
52
From Windows command prompt:

TRACERT www.gmail.com

Look at the output to determine where the route fails. If it's the ip address of the firewall, you know that's your problem.

>This code works on all the sites where I have installed it, except in some. The client.send() just fails. I guess this is firewall issue. I there anyway one can figure out why the client.send fails?
>
>Thanks (Sergey :) ).
>
>
>
>    Public Sub SendEmail(ByVal subject As String, ByVal messageBody As String, _
>     ByVal fromAddress As String, ByVal toAddress As String, ByVal ccAddress As String)
>
>        Dim message As New MailMessage()
>        Dim client As New SmtpClient()
>
>        'Set the sender's address
>        message.From = New MailAddress(fromAddress)
>        'Allow multiple "To" addresses to be separated by a semi-colon
>        If (toAddress.Trim.Length > 0) Then
>            For Each addr As String In toAddress.Split(";"c)
>                message.To.Add(New MailAddress(addr))
>            Next
>        End If
>
>        'Allow multiple "Cc" addresses to be separated by a semi-colon
>        If (ccAddress.Trim.Length > 0) Then
>            For Each addr As String In ccAddress.Split(";"c)
>                message.CC.Add(New MailAddress(addr))
>            Next
>        End If
>        'Set the subject and message body text
>        message.Subject = subject
>        message.IsBodyHtml = False
>        message.Body = messageBody
>
>        client.Host = "smtp.gMAIL.com"
>        client.Credentials = New System.Net.NetworkCredential("***@gmail.com", "***")
>        'client.Port = 587
>        client.Port = 465
>        client.EnableSsl = True
>        'Send the e-mail message
>        Dim l As Boolean = False
>        Try
>            client.Send(message)
>        Catch
>            l = True
>        End Try
>        If l Then
>            MsgBox("Send failure")
>        Else
>            MsgBox("OK")
>        End If
>    End Sub
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform