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, 3127 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, 2605 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, 2678 views)
Reply With Quote
  #10  
Old 06-12-2013, 09:49 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
I tried to use the sample you attached by filling the info for our Exchange email server -but what i see is chinese like below.
Maybe the problem is with our email server if you say the email sent by the script appeared ok in your case.
I would try to run this step with some other email server but not sure how to do it ,which server should I use.

䠼䵔㹌䠼䅅㹄਍䴼呅⁁瑨灴攭畱癩∽潃瑮湥⵴祔数•潣瑮湥㵴琢硥⽴瑨汭※档牡敳㵴呕ⵆ㘱㸢਍⼼䕈䑁㰾佂奄 ാ㰊ㅈ䈾極摬爠獥汵獴映牯戠極摬㰠⁡牨晥∽瑨灴⼺眯睷欮湩潯⹫潣≭ㄾ⸳⸱ㄱ㜳〮⼼㹡⼼ㅈാ㰊慴汢⁥瑳汹㵥戢 牯敤㩲⌠捤捤捤ㄠ硰猠汯摩∻ാ㰊琯扡敬ാഊ㰊䈯䑏㹙਍⼼呈䱍ാഊ
Reply With Quote
  #11  
Old 06-12-2013, 12:52 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Did the message we sent from Visual Build display properly?

Please send the message from Visual Build to support@kinook.com, and also post or send the info from http://www.kinook.com/Forum/showthread.php?t=3044.
Reply With Quote
  #12  
Old 06-13-2013, 02:24 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
I did not receive any message from you -which address did u use ?
Reply With Quote
  #13  
Old 06-13-2013, 03:11 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
sorry,I just saw the email from you.It is displayed correctly.So this means the problem is with our email server -it is transforming the message in chinese ?Any workaround to avoid this?
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 05:55 PM.


Copyright © 1999-2023 Kinook Software, Inc.