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. VB.Net & Emails

VB.Net & Emails

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
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.
  • D Offline
    D Offline
    directred
    wrote on last edited by
    #1

    Easy question for someone. Where do I get the control for MAPI I have VB.Net 2005

    A 1 Reply Last reply
    0
    • D directred

      Easy question for someone. Where do I get the control for MAPI I have VB.Net 2005

      A Offline
      A Offline
      Arjun Marwaha
      wrote on last edited by
      #2

      .NET does not have MAPI controls . I used MAPI controls from VB6 'add 2 controls Microsoft MAPIMessages (call it MAPIMessages1) Microsoft MAPISession (call it MAPILogOn) (AxInterop.MSMAPI.dll, Interop.MSMAPI.dll) Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim msg As String msg = "This is a test email from Iouri." With Me .MAPILogOn.SignOn() ' use current user Do While .MAPILogOn.SessionID = 0 System.Windows.Forms.Application.DoEvents() ' need to wait until the new session is created Loop Call SendToEmail("someone@somewhere.com", msg) .MAPILogOn.SignOff() End With MsgBox("e-mail is sent") End Sub Private Sub SendToEmail(ByVal Email As String, ByVal msg As String) With MAPIMessages1 'create a new message and address it .SessionID = MAPILogOn.SessionID .Compose() .RecipDisplayName = Email .AddressResolveUI = True .RecipAddress = "smtp:" & Email .MsgSubject = "VB GENERATED E-MAIL" .MsgNoteText =msg .Send(False) End With End Sub End Class Regards, Dave

      Dave Traister Software Engineer ComponentOne LLC www.ComponentOne.com

      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