Send a HTML mail using VB Mail MAPI component

I have picked up the VB Mail MAPI component. I wish to send the a mail. This component does this. My requirement is i wish to send a HTML Mail. (Created from within the VB code).
Need some help in this regards.

Also be able to view Public folders using this VB MAPI.
qualityacubeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

manojaminCommented:
Read this,
It alos has links to sample code...

HOWTO: Send an HTML Message Using MAPI and CDO
http://support.microsoft.com/support/kb/articles/Q216/3/44.ASP
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
qualityacubeAuthor Commented:
I am unable to download the code for the MAPI RTF .dll.

Anyway.. it does not talk of Sending HTML Mails but it talks only of Displaying them RTF Format.

My requirement is i want to view all those mails the same way the code displays but i wish to send them in HTML

The frmmain.mapimess.send will send the mail only in text format. I want to send the mail by adding my gifs,like...

I pick up a mail and concatenate with Question and Display a dialog for the user to add an answer and on clicking send concatenate the Header Image + Question + Mail + Answer + dialog text + Footer Image.

All this is to go in a HTML Format.

Please help ... i need to get this done by tomorrow.

Thanks in advance.
0
stuartpearsonCommented:
I bought this question and answer and the link doesn't work but I really need the answer.
Please help
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

manojaminCommented:
here you go, sample from MSDN, the site is,

http://msdn.microsoft.com/library/psdk/cdo/_denali_attachurl_method_cdonts_newmail_object_.htm

The key is to set the BodyFormat property to CdoBodyFormatHTML  (0) to send HTML format. Also, you can embed the images using AttachURL method so that all your images (and any other stuff that you may want to embed can be sent)

Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
 
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
HTML = HTML & "<meta name=""GENERATOR"" content=""Microsoft FrontPage 2.0"">"
HTML = HTML & "<title>Exchange CDO Example</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""#FFFFFF"">"
HTML = HTML & "<p><font size=""6"" face=""Arial Black""><strong>Exchange CDO " 
HTML = HTML & "Sample<img src=CDO.gif>"
HTML = HTML & "</strong></font></p>"
HTML = HTML & "<p>CDO for NTS allows an easy way to send mail."
HTML = HTML & "This example shows how the content can be an HTML page"
HTML = HTML & "which allows you to send rich text and inline graphics.</p>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
 
myMail.AttachURL "D:\wwwroot\CDO.gif", "CDO.gif"
myMail.From = "Example@microsoft.com"
myMail.To = "Someone@microsoft.com"
myMail.Subject = "Sample Message"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send



hope this helps...

0
stuartpearsonCommented:
Is there a similar solution using MAPI Controls where CDONTS is not available?
0
manojaminCommented:
You can use MAPI and not CDONTS for sending mails only if the machine on which the application is running has MS Outlook as Mail Client whose mail server is MS Exchange Server

CDONTS is just like any SMTP mail wrapper (ofcourse with fancy HTML emailing). As long as you know the mail server addrress and have NT server you can use CDONTS... (you can write your own SMTP mail client otherwise which will work on any OS as long as you know the SMTP mail server address and valid with valid From e-mail address)

Here is the code for MAPI,

http://support.microsoft.com/support/kb/articles/Q140/4/47.asp

hope this helps you...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

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.