Sign in to follow this  
Followers 0
Borje

cdo Send html code

4 posts in this topic

Hello is here anybody know syntax to read html code and then send this, i have test to read a file

$objMessage.CreateMHTMLBody("file://C:/test.htm") and that works but I would like to integrate it

in the script and not needed the file.

Anybody ?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Thanks Zedna

I have try you example and that works i have test the same before but what i try is

this little file a have in html format I can not have this to work inside the script

and not need the separate file test.html..

Html Code:

<html>

<head>

<title>Test Text here</title>

</head>

<table cellpadding=5 cellspacing=5 border=2 bordercolor=#666666 bgcolor="#C0C0C0">

<tr>

<td align=center colspan="2" bgcolor="#33CCCC">

<b>

<font size="5">Test Message</font><br>

<font color=#000080</font>

</b>

</td>

</tr>

<tr>

<td align=center bgcolor="#E41B17">

<b><font size="5" color="#FFFFFF">Some text</font></b>

</td>

<td align=center bgcolor="#E41B17">

<font color="#FFFFFF">Sunday</font>

</td>

</tr>

<tr>

<td align=right bgcolor="#33CCCC"color="#FFFFFF">Some other text</td>

<td align=left bgcolor="#33CCCC">

<font color="#000000">Other text</font>

</tr>

<tr>

<td align=right bgcolor="#33CCCC">Some other text</td>

<td align=left bgcolor="#33CCCC">

<font color="#000000">Other text</font>

</tr>

<tr>

</table>

</body>

</html>

Edited by Borje

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I have solved the first problem to send this html example and have that to works now, the solution was to take all html code and insert this

$objMessage.HTMLBody = "all html code here" and it works with minimum changes..

But one another question is:

If i have a string value and would like to put in the value from a example $Date in the html code there the text (Other text) appear.

$Date = "2010-11-28" and have this in other text"

<font color="#000000">Other text</font>

Anybody have some tips?

Edited by Borje

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0