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. email

email

Scheduled Pinned Locked Moved Visual Basic
helpcsharpcomgraphics
6 Posts 3 Posters 1 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.
  • C Offline
    C Offline
    Cristian_Dior
    wrote on last edited by
    #1

    can someone help exporting from .Net to Visual Basic 6.0?? I'm new to Visual Basic so i created a visual basic code in .net Imports System.Web.Mail.MailMessage 'Imports CDO Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents buttonSend As System.Windows.Forms.Button Private Sub InitializeComponent() Me.buttonSend = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'buttonSend ' Me.buttonSend.Location = New System.Drawing.Point(104, 88) Me.buttonSend.Name = "buttonSend" Me.buttonSend.TabIndex = 0 Me.buttonSend.Text = "Button1" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 273) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.buttonSend}) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region 'These 3 were added while I was debugging the problem, but they don't seem to help Dim MailMsg As System.Web.Mail.MailMessage Dim MailSrvr As System.Web.Mail.SmtpMail Private Function mail() MailMsg = New System.Web.Mail.MailMessage() MailMsg.From = "from@email" MailMsg.Body = "Test Message!" MailMsg.Subject = "HI" MailMsg.To = "person@test.com" Try MailSrvr.SmtpServer = "server.com" MailSrvr.Send(MailMsg) MsgBox("erfolgreich") Catch err As Exce

    N 1 Reply Last reply
    0
    • C Cristian_Dior

      can someone help exporting from .Net to Visual Basic 6.0?? I'm new to Visual Basic so i created a visual basic code in .net Imports System.Web.Mail.MailMessage 'Imports CDO Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents buttonSend As System.Windows.Forms.Button Private Sub InitializeComponent() Me.buttonSend = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'buttonSend ' Me.buttonSend.Location = New System.Drawing.Point(104, 88) Me.buttonSend.Name = "buttonSend" Me.buttonSend.TabIndex = 0 Me.buttonSend.Text = "Button1" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 273) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.buttonSend}) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region 'These 3 were added while I was debugging the problem, but they don't seem to help Dim MailMsg As System.Web.Mail.MailMessage Dim MailSrvr As System.Web.Mail.SmtpMail Private Function mail() MailMsg = New System.Web.Mail.MailMessage() MailMsg.From = "from@email" MailMsg.Body = "Test Message!" MailMsg.Subject = "HI" MailMsg.To = "person@test.com" Try MailSrvr.SmtpServer = "server.com" MailSrvr.Send(MailMsg) MsgBox("erfolgreich") Catch err As Exce

      N Offline
      N Offline
      Nic Rowan
      wrote on last edited by
      #2

      You want to convert from .NET BACK to VB 6.0?:wtf:! E-Gad man why?:omg: As far as I remember VB 6's E-Mailing system was quite different to .NET's. .NET deals with objects and VB 6.0 well... didn't quite do it that way. I'm not quite sure if it's going to be possible using your current code... But I may be wrong. :~


      Beware the chickens, for in their silence, they plot... Life is too short to be taken seriously. -- Oscar Wilde


      J 1 Reply Last reply
      0
      • N Nic Rowan

        You want to convert from .NET BACK to VB 6.0?:wtf:! E-Gad man why?:omg: As far as I remember VB 6's E-Mailing system was quite different to .NET's. .NET deals with objects and VB 6.0 well... didn't quite do it that way. I'm not quite sure if it's going to be possible using your current code... But I may be wrong. :~


        Beware the chickens, for in their silence, they plot... Life is too short to be taken seriously. -- Oscar Wilde


        J Offline
        J Offline
        jspano
        wrote on last edited by
        #3

        Your right, It isn't possible using the code supplied. I don't think vb6 has any mail capability built in for smtp. You will have to use the windows api and roll your own. You can use the outlook framework from vb6, but then you make your code rely on the fact that outlook must be installed.

        C 1 Reply Last reply
        0
        • J jspano

          Your right, It isn't possible using the code supplied. I don't think vb6 has any mail capability built in for smtp. You will have to use the windows api and roll your own. You can use the outlook framework from vb6, but then you make your code rely on the fact that outlook must be installed.

          C Offline
          C Offline
          Cristian_Dior
          wrote on last edited by
          #4

          thank you for your help,the reason why i want it in vb6.0 is because vb 6.0 is installed on every workstation so everyone can use the code .net not What about VBA? is it possible to send Smtp mail? Thanx

          J 1 Reply Last reply
          0
          • C Cristian_Dior

            thank you for your help,the reason why i want it in vb6.0 is because vb 6.0 is installed on every workstation so everyone can use the code .net not What about VBA? is it possible to send Smtp mail? Thanx

            J Offline
            J Offline
            jspano
            wrote on last edited by
            #5

            I know almost 0 about vba, but I believe it is just a subset of vb6? So I would guess that you would have the same problems. If you have vba though that means you have some of office installed on the users cpu. If you have outlook that might work for you.

            C 1 Reply Last reply
            0
            • J jspano

              I know almost 0 about vba, but I believe it is just a subset of vb6? So I would guess that you would have the same problems. If you have vba though that means you have some of office installed on the users cpu. If you have outlook that might work for you.

              C Offline
              C Offline
              Cristian_Dior
              wrote on last edited by
              #6

              i know,why make it difficult,:-) with outlook is it quite easier but i don't wanna use outlook.I got it in vb6,hope i can use the code in vba,but im gonna finish work today :-) I'll try it tomorrow so anyway thank u Thanx

              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