Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sending mail in vb6.0 usering MAPIMessages controller

Posted on 2008-06-25
4
Medium Priority
?
1,212 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

773 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