Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 11 votes, 5.00 average. Display Modes
  #1  
Old 03-05-2007, 10:13 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Send email as HTML

Hi
I need to implement in VBuild this steps from NANT:
<target name="MailNightlyReport">
<mail mailhost="${mail.smtp.server}" from="${mail.from}" cclist="${mail.complete.results.cclist}" tolist="${mail.cclist}" subject="Nightly build result: ${build.result.string} [${assembly.version}]" format="Html" failonerror="false">
<files>
<include name="${console.outputs.location}\index.html"/>
</files>
</mail>
</target>
Basically I need to send an email as HTML but I am not sure how to do this in VBP.I see in the step Send Mail ->the option Send as HTML but how can I load into Message section the file index.html being created at run time (when VBP is running)?
Reply With Quote
  #2  
Old 03-05-2007, 11:22 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
[vbld_GetFileContents("c:\path\to\index.html")]

http://www.visualbuild.com/Manual/scriptexpressions.htm
http://www.visualbuild.com/Manual/sysscriptfile.htm
Reply With Quote
  #3  
Old 03-05-2007, 02:25 PM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Thanks for the tip.In the Send Mail step,into the Message field I wrote [vbld_GetFileContents("c:\path\to\index1.html")].
But when the email is sent-in the body it is written only :
ÿþ<
I attached that index1.html to that email-it is ok,only the message body is corrupted.
I will attach here that index1.html,maybe still that fction vbld_GetFileContents cannot work with html files???
I do not understand why it is not working properly.
Attached Files
File Type: zip index1.zip (945 Bytes, 3153 views)
Reply With Quote
  #4  
Old 03-05-2007, 06:37 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The file is UTF-16 encoded. You need to specify Unicode mode when opening the file.

[vbld_EscapeString(vbld_FSO.OpenTextFile("C:\index1 .html", , , True).ReadAll)]
Reply With Quote
  #5  
Old 03-06-2007, 03:12 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
It works now,thanks a lot!!!
Reply With Quote
  #6  
Old 06-12-2013, 05:16 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Hi,i have issues again with this and i do not understand why as it used to work ok.

Since september 2012 I decided to send the html as attachment to the email.Now it was requested to be sent again as email body ,reactivated the 'send email' step as before and having in Message part:
[vbld_EscapeString(vbld_FSO.OpenTextFile("%CURRBUIL D_OUTPUT_FOLDER%\index.html", , , True).ReadAll)]

and the option "Send as HTML message" checked -but the email body I receive is in chinese :-)
When I uncheck the option "Send as HTML message" -the email body is the HTML code for index.html so it does not help me .Any idea why I got the email in chinese after checking the option "Send as HTML message" ?
Reply With Quote
  #7  
Old 06-12-2013, 06:52 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Probably a) the file is not UTF-16 encoded or b) the email reader can't handle UTF-16 encoded content.
Reply With Quote
  #8  
Old 06-12-2013, 07:20 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
i attached the file I am trying to read and put into the email body .Not sure how to check if it is UTF-16 encoded.
Email reader is Microsoft Outlook 2010
Attached Files
File Type: zip index.zip (381 Bytes, 2633 views)
Reply With Quote
  #9  
Old 06-12-2013, 07:43 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
It is Unicode. Sending here with VBP 8.4 and the attached .bld file worked as expected when sending to a gmail account. I also sent it to your address.
Attached Images
 
Attached Files
File Type: bld send.bld (828 Bytes, 2699 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 10:10 AM.


Copyright © 1999-2023 Kinook Software, Inc.