Solved

Sending mail in vb6.0 usering MAPIMessages controller

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

829 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