You must Sign In to post a response.
  • Category: Suggestions

    Is VB Email implemented?

    I have a requirement to test a system using some kind of email.

    I have already tried gmail, but it doesn't work using any of the standard settings. It timeouts or generates other errors.

    Is email implemented using the VB.NET library on this site?
  • #6827
    we have not implemented any specific email system with our free hosting services. However, if you have access to your own smtp services or gmail, you will be able to use it on our server. Search in Google for how to send mails using Gmail with C# or VB.NET. The solutions you find on the web will work on our ASP.NET free hosting services as well.

  • #6834
    I will check it out.

    Another member has tried it without success, and I have been pretty much getting the same results, but I don't get any results using localhost either, so I am probably doing something not quite right.

  • #6835
    I got it to work using the following code (modified to meet my needs):


    Imports System.Net.Mail

    'Start by creating a mail message object
    Dim MyMailMessage As New MailMessage()

    'From requires an instance of the MailAddress type
    MyMailMessage.From = New MailAddress("from_address_here@gmail.com")

    'To is a collection of MailAddress types
    MyMailMessage.To.Add("to_address_here@domain_name_here")

    MyMailMessage.Subject = "GMail Test"
    MyMailMessage.Body = "This is the test text for Gmail email"

    'Create the SMTPClient object and specify the SMTP GMail server
    Dim SMTPServer As New SmtpClient("smtp.gmail.com")
    SMTPServer.Port = 587
    SMTPServer.Credentials = New System.Net.NetworkCredential("account uid", " account pwd")
    SMTPServer.EnableSsl = True

    Try
    SMTPServer.Send(MyMailMessage)
    'MessageBox.Show("Email Sent")
    Catch ex As SmtpException
    'MessageBox.Show(ex.Message)
    End Try

  • #6836
    Timothy,

    Thanks for sharing the code to make the email work with the AspSpider free web hosting services.

  • #6837
    I also added the email configuration information to the web.config file, and that may make a difference.

    The above code didn't work for me originally.

    I also added it to a library file (.dll) that I use and that also may be making the difference.


  • Sign In to post your comments