CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012
    Posts
    35

    HTML problem with a variable

    I am using VB5 and tring to send an Email in HTML using CDO so that I can control formatting and colors etc. I can do it in Text just fine( but without the formating and colors).

    I am new to HTML.

    I need to bring in some variable fields into the Body but I can't find out how. In the HTML body I want to insert a client's "CompanyName, CompanyAddress" (variable fields) after the <body> and before the <p1>. My code is below:

    Code:
    '****
    With cdoMsg
            .To = MsgToEmailAddr
            .From = MsgFrom
            .Subject = MsgSubject
            .HtmlBody = "<html><body>" _
                & "<p1><font size='7' face='times new roman' color='red'>HAPPY BIRTHDAY
                & "</body></html>"
            Set .Configuration = cdoConfig
            .Send
       End With
    '****

    How do I do this?

    Thanks for the help!!
    Last edited by PeejAvery; February 11th, 2012 at 11:07 PM. Reason: Added code tags

  2. #2
    Join Date
    Jan 2012
    Posts
    35

    Re: HTML problem with a variable

    Sorry for the false alarm. I took a break and figured it out for myself.

    Used :& "</br><p1>" & txtDlrAddr & "</p1>" _

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured