|
#1
|
|||
|
|||
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)? |
#2
|
|||
|
|||
[vbld_GetFileContents("c:\path\to\index.html")]
http://www.visualbuild.com/Manual/scriptexpressions.htm http://www.visualbuild.com/Manual/sysscriptfile.htm |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
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)] |
#5
|
|||
|
|||
It works now,thanks a lot!!!
|
#6
|
|||
|
|||
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" ? |
#7
|
|||
|
|||
Probably a) the file is not UTF-16 encoded or b) the email reader can't handle UTF-16 encoded content.
|
#8
|
|||
|
|||
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 |
#9
|
|||
|
|||
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.
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|