Solved

Sending mail in vb6.0 usering MAPIMessages controller

Posted on 2008-06-25
4
1,199 Views
Last Modified: 2013-12-25
hi,
  I am trying to send emails using mapi messages control in VB 6.0 to Outlook. Although i can send mail to one recipient address, but can't send to more then one addresses and to CC. Can any one assist me in this regards
Thnx
0
Comment
Question by:aib_it
  • 4
4 Comments
 

Author Comment

by:aib_it
ID: 21874605
hi, yet i didnt received any comment, any how i have tried with  

MAPIM1.SessionID = MAPIS1.SessionID
 
    MAPIM1.Compose
    MAPIM1.RecipDisplayName = "Maiwand Ludin"
    MAPIM1.RecipAddress = "maiwand88@hotmail.com"
    MAPIM1.AddressResolveUI = True
    MAPIM1.MsgSubject = "Test"
    MAPIM1.MsgNoteText = "body text"
    MAPIM1.Send False
    MAPIS1.SignOff

and also with this code
    Dim ol As New Outlook.Application
    Dim ns As Outlook.NameSpace
    Dim newMail As Outlook.MailItem
    Set ns = ol.GetNamespace("MAPI")
   Set newMail = ol.CreateItem(olMailItem)
    With newMail
   .Subject = "Advices"
  .Body = "Automatic message:" & vbCrLf
   With .Recipients.Add("maiwand88@hotmail.com")
   .Type = olTo
   If Not .Resolve Then
   MsgBox "Unable to resolve address.", vbInformation
   Exit Sub
   End If
   End With
   With .Attachments.Add _
    ("C:\Documents and Settings\mailud\Desktop\Reports.txt")
 .DisplayName = "Training info"
  End With
  .Send
    End With
  Set ol = Nothing
    Set ns = Nothing
    Set newMail = Nothing
In the above both i can send mails to one mail id only but not to more then one and To CC. If any further Detail Required, Kindly let me know
Thanks
0
 

Author Comment

by:aib_it
ID: 21893044
Hi,
Yet i didnt received any comments regarding to it, any way now i can send mail to multiple recipients using recipindex. Is there some one who can tell me how to send to mail cc recipient.
0
 

Accepted Solution

by:
aib_it earned 0 total points
ID: 21905076
hi,
     For the sending maill to cc using mapi cotrol we have to make the RecipType = 2. ( seconed Line.)
0
 

Author Comment

by:aib_it
ID: 21905081
kindly refined my points.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now