Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Sending an HTML email in code (XP)

    My client needs to send out a thousand emails to advise clients and suppliers of a change of address. The body of the email needs to be HTML. I am using this code to send emails (With ClickYes)
    Set objOA = New Outlook.Application
    Set objMI = objOA.CreateItem(olMailItem)
    objMI.To = strTo
    objMI.CC = strCC
    objMI.BCC = strBCC
    objMI.Subject = strSubject
    objMI.Body = strMessage
    objMI.Send

    is there a way to either - insert the Message as HTML or use an email template?
    How many addresses can you put in a BCC before it explodes?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sending an HTML email in code (XP)

    Instead of setting the Body property, you can set the BodyHTML property to a string with HTML tags. You'll also want to set the BodyFormat property to olFormatHTML to make sure the e-mail is in HTML format.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sending an HTML email in code (XP)

    It's possible to put thousands of e-mail addresses in To, Cc or Bcc but it may be better to split it up into smaller chunks.

  4. #4
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sending an HTML email in code (XP)

    That's great, thanks yet again Hans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •