• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 627
  • Last Modified:

MAPI

Is it possible to use MAPI to send HTML e-mail?  If so, please provide an example.
0
_Canidae_
Asked:
_Canidae_
  • 7
  • 3
  • 2
  • +1
1 Solution
 
WolfgangKoenigCommented:

hearing
0
 
_Canidae_Author Commented:
Uh huh.
0
 
WolfgangKoenigCommented:
Here is an example to send 'normal' text via MAPI:

Put the code in Module...  
'make sure that on the default e-mail use of MAPI server is allowed

Option Explicit
'2 controls Microsoft MAPI Control 6.0 -> MAPISession and MAPIMessages

Private Sub Command1_Click()
 Dim msg As String
 
 Screen.MousePointer = vbHourglass
 
 msg = "This is a test email"
 
 With Me

   .MAPILogOn.SignOn ' use current user
 
   Do While .MAPILogOn.SessionID = 0
     DoEvents ' need to wait until the new session is created
   Loop
   
  Call SendToEmail("iboutchkine@hotmail.com", msg)
   
   .MAPILogOn.SignOff
 End With
 
 Screen.MousePointer = vbNormal
 
End Sub

Private Sub SendToEmail(ByVal Email As String, ByVal msg As String)
 With MAPIMessages1
   'create a new message and address it
   .SessionID = MAPILogOn.SessionID
   .Compose
   .RecipDisplayName = Email
   .AddressResolveUI = True
   .RecipAddress = "smtp:" & Email
   
   .MsgSubject = "VB GENERATED E-MAIL"
   .MsgNoteText = msg
  'if True then open Netscape and wait, if false then sends to Eudora.
   .Send False
 End With
End Sub

Hope this helps a litte
WoK

0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
_Canidae_Author Commented:
Thanks but I already know how to send plain text using MAPI.  I need to know if it's possible to send HTML with MAPI, and if so, how.
0
 
cbitservicesCommented:
Hi Canidae,

It isn't possible using MAPI, but can be done using Extended Mapi. Let me have your e-mail address (send an e-mail to me at: email removed - Bingie EE PE) and I will send you a sample project with all the info.

Regards,

Colin.
0
 
_Canidae_Author Commented:
Thanks, I'm mailing now.
0
 
_Canidae_Author Commented:
I haven't had a chance to try out what you sent me, but I'm sure it will work when I eventually do!
0
 
cbitservicesCommented:
Hi Canidae,

It worked for me, but if you have any problems let me know (by e-mail) and I will help further if I can.

Regards,

Colin.
0
 
jkanisutCommented:
Hello,

Can I get a copy of the Extended-MAPI code?

Joe
0
 
_Canidae_Author Commented:
With it being four years later and all, I might have some trouble finding it...
0
 
jkanisutCommented:
Yea... I'm working four years behind the times... if you can find it, I'd appreciate it.
0
 
_Canidae_Author Commented:
Just had a search through my e-mails and can't find it.  Must be plenty of examples online though!
0
 
jkanisutCommented:
Thanks... not much luck searching.  I did run accross Outlook Redemption... going to try that.
0
 
_Canidae_Author Commented:
If I recall correctly, I never got it working anyway.  I think I eventually resorted to using JMail to accomplish HTML e-mail-sending.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 7
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now