#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.
|
#10
|
|||
|
|||
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. 䠼䵔㹌䠼䅅㹄䴼呅⁁瑨灴攭畱癩∽潃瑮湥祔数•潣瑮湥㵴琢硥⽴瑨汭※档牡敳㵴呕ⵆ㘱㸢⼼䕈䑁㰾佂奄 ാ㰊ㅈ䈾極摬爠獥汵獴映牯戠極摬㰠牨晥∽瑨灴⼺眯睷欮湩潯潣≭ㄾ⸳⸱ㄱ㜳〮⼼㹡⼼ㅈാ㰊慴汢瑳汹㵥戢 牯敤㩲⌠捤捤捤ㄠ硰猠汯摩∻ാ㰊琯扡敬ാഊ㰊䈯䑏㹙⼼呈䱍ാഊ |
#11
|
|||
|
|||
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. |
#12
|
|||
|
|||
I did not receive any message from you -which address did u use ?
|
#13
|
|||
|
|||
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?
|
|
|