Solved

Sending mail in vb6.0 usering MAPIMessages controller

Posted on 2008-06-25
4
1,208 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

696 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