Embede multiple HTML files in e-mail body

Tagged: 

This topic contains 5 replies, has 4 voices, and was last updated by Profile photo of Paul Frankovich Paul Frankovich 7 months ago.

  • Author
    Posts
  • #38671
    Profile photo of Venkata Kalyan
    Venkata Kalyan
    Participant

    Hi,
    I have five HTML files & try to embed all these to e-mail body.
    Example below:

    E-mail body must look like below:

    The below contains D1 information
    Embed 1.HTML

    The below contains D2 information
    Embed 2.HTML

    I wrote a script, but it is not getting me the desired output:
    $body = get-content .\content.htm
    $message.body = $body

    -Kalyan

  • #38676
    Profile photo of random commandline
    random commandline
    Participant

    Do you need the name of each html file in email body or the contents of each html file in email body?

  • #38678
    Profile photo of Dan Potter
    Dan Potter
    Participant
    $a = ""
    $a = $a + "BODY{background-color:white;FONT-SIZE: 8pt; FONT-FAMILY: verdana}"
    $a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
    $a = $a + "TH{border-width: 1px;padding: 3px;border-style: solid;border-color: black;color: red;background-color:#CCCCCC}"
    $a = $a + "TD{border-width: 1px;padding: 3px;border-style: solid;border-color: black;background-color:white}"
    $a = $a + ""
    
    #somestuff
    
    get-process |ConvertTo-HTML -head $a | out-file test.htm
    
    #somemorestuff
    
    get-service |ConvertTo-HTML -head $a -body '' | out-file test.htm  -append
  • #38679
    Profile photo of Dan Potter
    Dan Potter
    Participant

    There are supposed to be to html breaks in between the quoutes in the second command. forum removes them.

  • #38918
    Profile photo of Venkata Kalyan
    Venkata Kalyan
    Participant

    Thanks. Worked fine.

    -Kalyan

  • #38919
    Profile photo of Paul Frankovich
    Paul Frankovich
    Participant

    Doesn't this literally make two separate HTML files and cram them together in the same file giving the file two HEAD sections? I see that Vakat said it works, but is it the best way to do it?

You must be logged in to reply to this topic.