Link to home
Start Free TrialLog in
Avatar of CraigLazar
CraigLazar

asked on

create an html email in vb ?

Hi
at the moment my little app is creating a email in plain text, but
i need to be able to add fonts,colors, and mybe some small images into the body of the email.
Very similar to the html question notifications we receive from experts exchange on our questions -

thanks a
stack\


cheers
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Use CDONTS (or possibly CDO, as CDONTS is being phased out).
ASKER CERTIFIED SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vinnyd79
vinnyd79

If you use Outlook you can try something like this:


Private Sub Command1_Click()
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)

With objOutlookMsg
    .To = "someone@somewhere.com"
    .Cc = "someoneelse@somewhere.com"
    .Subject = "Hello......"
    .Body = "This is the body of message"
    .HTMLBody = "<H1>HTML version of message</H1>"
  '  .Attachments.Add ("c:\myFileToSend.txt")
    .Send
End With

Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
Avatar of CraigLazar

ASKER

hi guys
thanks a stack, sorry i have been hectic,
will get to it now

thanks

cheers
Hi
so sorry been away and so busy,
i have this week to go thru this stuff, canu please leave the question open for this
week and i promise to close it up by the ned of the week

thanks so much
Sorry to the experts who have helped here