Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. What is wrong with this code??

What is wrong with this code??

Scheduled Pinned Locked Moved Visual Basic
questioncomdebugginghelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hengy
    wrote on last edited by
    #1

    Private Sub Image1_Click() Dim SMTP As Object Set SMTP = CreateObject("ANSMTP.Mail") SMTP.ServerAddr = "pophm.sympatico.ca" SMTP.FromAddr = "email@email.com" 'sender' email address SMTP.AddRecipient "Me", "email@email.com", 0 SMTP.BodyFormat = 1 SMTP.Subject = Text1.Text & Text2.Text SMTP.BodyText = Text1.Caption & Text2.Caption If SMTP.SendMail() = 0 Then 'send email MsgBox "Email delivered", vbOKOnly, "ANSMTP COM Object" Else MsgBox SMTP.GetLastErrDescription, vbOKOnly, "ANSMTP COM Object" End If End Sub When I try and run it it gives me a run-time error #429. I debug it and it highlights the third line. (Set SMTP = CreateObject...) Hengy I like Pie

    G 1 Reply Last reply
    0
    • H Hengy

      Private Sub Image1_Click() Dim SMTP As Object Set SMTP = CreateObject("ANSMTP.Mail") SMTP.ServerAddr = "pophm.sympatico.ca" SMTP.FromAddr = "email@email.com" 'sender' email address SMTP.AddRecipient "Me", "email@email.com", 0 SMTP.BodyFormat = 1 SMTP.Subject = Text1.Text & Text2.Text SMTP.BodyText = Text1.Caption & Text2.Caption If SMTP.SendMail() = 0 Then 'send email MsgBox "Email delivered", vbOKOnly, "ANSMTP COM Object" Else MsgBox SMTP.GetLastErrDescription, vbOKOnly, "ANSMTP COM Object" End If End Sub When I try and run it it gives me a run-time error #429. I debug it and it highlights the third line. (Set SMTP = CreateObject...) Hengy I like Pie

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Have you installed the component on the computer? --- b { font-weight: normal; }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups