Solved

Sending mail in vb6.0 usering MAPIMessages controller

Posted on 2008-06-25
4
1,201 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

947 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

18 Experts available now in Live!

Get 1:1 Help Now