Results 1 to 5 of 5

Thread: Send HTML Mail

  1. #1
    New Lounger
    Join Date
    Jan 2001
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Send HTML Mail

    I have inherited some Word/VBA code that sends an e-mail through the mapi.session object by adding an item to the outbox folder. Is there a message property (or other easy way) to send the e-mail as html? Or what do I have to do to send it as html? Thanks.
    Mike G

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send HTML Mail

    Do you want to programmatically create the entire message then send it in HTML format?

    If so, just load up the .HMTLBody property of a new mail item object and away you go.

    Do your object declarations, etc. then something like this:
    <pre>With objNewMessage
    .To = "MIKE"
    .Subject = "An HTML message"
    .HTMLBody = "<HTML><H2>My HTML page.</H2><BODY>My body.</BODY></HTML>"
    .send
    End With
    </pre>

    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    New Lounger
    Join Date
    Jan 2001
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send HTML Mail

    Thanks Kevin. How about if I want to send the active dcoument? It is an HTM file, open in Word, and I want the macro to send it as html?
    Thanks
    Mike G

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send HTML Mail

    Save the document with the saveas method.

    Word 97:

    ActiveDocument.SaveAs FileName:="heyhey", FileFormat:=FileConverters("HTML").SaveFormat

    You must have the converter installed for that to work.

    Word 200x:

    Activedocument.SaveAs FileName:="heyhey", FileFormat:=wdFormatHTML

    Then use the .attachment.add "heyhey" for the mail msg object.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    New Lounger
    Join Date
    Jan 2001
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send HTML Mail

    Thanks again Kevin. That might do it for the customer. The application is an e-mail blast that is currently sending text e-mails and he wants it to merge personal info into each e-mail and then send the personalized html e-mails out. Sounds like I need to re-think the process to get it to do what he wants.
    Mike

Posting Permissions

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