Send Email in HTML format 
Author Message
 Send Email in HTML format

I am programming in Office 97.  I am programming from Access to send an
email to Outlook in VBA.  I am using code such as the following to send the
email:

    With objMessage
        .To = "John Smith"
        .Subject = "Order Acknowledgement"
        .Body = strMessage
        .Send
    End With

How can I send an HTML file, not as an attachment, but as the text that is
sent in the body?  What properties can I set?  Can somebody point me to a
code sample?

Thank You,
Derek



Mon, 19 Jan 2004 12:33:21 GMT  
 Send Email in HTML format
Set HTMLBody, not Body. strMessage would need to be the fully tagged HTML
you want to display in the message.
--

Sue Mosher, Outlook MVP
Author of
     Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
     Microsoft Outlook 2000 E-mail and Fax Guide
Outlook and Exchange solutions at http://www.slipstick.com


Quote:
> I am programming in Office 97.  I am programming from Access to send an
> email to Outlook in VBA.  I am using code such as the following to send
the
> email:

>     With objMessage
>         .To = "John Smith"
>         .Subject = "Order Acknowledgement"
>         .Body = strMessage
>         .Send
>     End With

> How can I send an HTML file, not as an attachment, but as the text that is
> sent in the body?  What properties can I set?  Can somebody point me to a
> code sample?

> Thank You,
> Derek



Mon, 19 Jan 2004 19:25:06 GMT  
 Send Email in HTML format
Can I grab an HTML file and place it in the email?  Or do I have to read the
HTML into a variable to set it in strMessage?

Derek


Quote:
> Set HTMLBody, not Body. strMessage would need to be the fully tagged HTML
> you want to display in the message.
> --

> Sue Mosher, Outlook MVP
> Author of
>      Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
>      Microsoft Outlook 2000 E-mail and Fax Guide
> Outlook and Exchange solutions at http://www.slipstick.com



> > I am programming in Office 97.  I am programming from Access to send an
> > email to Outlook in VBA.  I am using code such as the following to send
> the
> > email:

> >     With objMessage
> >         .To = "John Smith"
> >         .Subject = "Order Acknowledgement"
> >         .Body = strMessage
> >         .Send
> >     End With

> > How can I send an HTML file, not as an attachment, but as the text that
is
> > sent in the body?  What properties can I set?  Can somebody point me to
a
> > code sample?

> > Thank You,
> > Derek



Tue, 20 Jan 2004 03:38:50 GMT  
 Send Email in HTML format
If you're starting from an HTML file, read its content into a string
variable and set that HTMLBody equal to that variable.

--

Sue Mosher, Outlook MVP
Author of
     Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
     Microsoft Outlook 2000 E-mail and Fax Guide
Outlook and Exchange solutions at http://www.slipstick.com


Quote:
> Can I grab an HTML file and place it in the email?  Or do I have to read
the
> HTML into a variable to set it in strMessage?

> Derek



> > Set HTMLBody, not Body. strMessage would need to be the fully tagged
HTML
> > you want to display in the message.



> > > I am programming in Office 97.  I am programming from Access to send
an
> > > email to Outlook in VBA.  I am using code such as the following to
send
> > the
> > > email:

> > >     With objMessage
> > >         .To = "John Smith"
> > >         .Subject = "Order Acknowledgement"
> > >         .Body = strMessage
> > >         .Send
> > >     End With

> > > How can I send an HTML file, not as an attachment, but as the text
that
> is
> > > sent in the body?  What properties can I set?  Can somebody point me
to
> a
> > > code sample?

> > > Thank You,
> > > Derek



Tue, 20 Jan 2004 04:51:45 GMT  
 Send Email in HTML format
How do I read an HTML file into a variable?

Derek


Quote:
> If you're starting from an HTML file, read its content into a string
> variable and set that HTMLBody equal to that variable.

> --

> Sue Mosher, Outlook MVP
> Author of
>      Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
>      Microsoft Outlook 2000 E-mail and Fax Guide
> Outlook and Exchange solutions at http://www.slipstick.com



> > Can I grab an HTML file and place it in the email?  Or do I have to read
> the
> > HTML into a variable to set it in strMessage?

> > Derek



> > > Set HTMLBody, not Body. strMessage would need to be the fully tagged
> HTML
> > > you want to display in the message.



> > > > I am programming in Office 97.  I am programming from Access to send
> an
> > > > email to Outlook in VBA.  I am using code such as the following to
> send
> > > the
> > > > email:

> > > >     With objMessage
> > > >         .To = "John Smith"
> > > >         .Subject = "Order Acknowledgement"
> > > >         .Body = strMessage
> > > >         .Send
> > > >     End With

> > > > How can I send an HTML file, not as an attachment, but as the text
> that
> > is
> > > > sent in the body?  What properties can I set?  Can somebody point me
> to
> > a
> > > > code sample?

> > > > Thank You,
> > > > Derek



Tue, 20 Jan 2004 08:52:40 GMT  
 Send Email in HTML format
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("c:\testfile.htm", ForReading)
strText = ts.ReadAll

Not sure if this was mentioned, but if you are using Outlook 97 from Office
97 ~ then you can't send HTML formatted mail.  HTML support was introduced
in Outlook 98.


Quote:
> How do I read an HTML file into a variable?

> Derek



> > If you're starting from an HTML file, read its content into a string
> > variable and set that HTMLBody equal to that variable.

> > --

> > Sue Mosher, Outlook MVP
> > Author of
> >      Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
> >      Microsoft Outlook 2000 E-mail and Fax Guide
> > Outlook and Exchange solutions at http://www.slipstick.com

[snip]


Tue, 20 Jan 2004 10:49:49 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Help! Send email as HTML format from Excel

2. Sending Email in HTML format

3. How to send email in HTML format?

4. Sending email in HTML format

5. Sending Email in HTML format

6. How to send email in HTML format from code?

7. Send formatted HTML emails via vba

8. sending an email in html format

9. Sending HTML formatted email - images don't get embedded

10. Sending HTML format in Email messages using SMTP prototocal

11. How to send an email in HTML format

12. send an eMail in HTML format

 

 
Powered by phpBB® Forum Software