Results 1 to 2 of 2

Thread: Sending email through VB.NET

  1. #1

    Thread Starter
    New Member russgreen's Avatar
    Join Date
    Apr 2003
    Posts
    12

    Sending email through VB.NET

    I have made a real simple email client that works. However, the email is sent but it just takes for ever to get delivered. Why is that? The exact same email sent to the same address through the same ISP servers when sent through Outlook is virtually instant.

    When I try to send though the local SMTP service on WinXP I get "Error!! Could not access 'CD).Message' object"

    My code is below...

    TIA
    Russ

    VB Code:
    1. Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
    2.         Dim email As New MailMessage
    3.         If txtSmtpServer.Text <> "localhost" Then
    4.             SmtpMail.SmtpServer = Trim(txtSmtpServer.Text)
    5.         End If
    6.  
    7.         email.To = Trim(Me.txtTo.Text)
    8.         email.From = Trim(Me.txtFrom.Text)
    9.         email.Subject = Trim(Me.txtSubj.Text)
    10.         email.Body = Trim(Me.txtBody.Text)
    11.         email.BodyFormat = MailFormat.Text
    12.         email.Priority = MailPriority.High
    13.  
    14.         Try
    15.             SmtpMail.Send(email)
    16.             MsgBox("Email Sent!!!", MsgBoxStyle.Information)
    17.         Catch ex As Exception
    18.             MsgBox("Error!!" + vbLf + ex.Message, MsgBoxStyle.Critical)
    19.         End Try
    20.     End Sub 'btnSend_Click

  2. #2
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784
    I got same problem .. please let me know how do you solve this problem? .. TIA

    Winanjaya

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width