View Full Version : Send email as HTML
teognost
03-05-2007, 10:13 AM
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)?
kinook
03-05-2007, 11:22 AM
[vbld_GetFileContents("c:\path\to\index.html")]
http://www.visualbuild.com/Manual/scriptexpressions.htm
http://www.visualbuild.com/Manual/sysscriptfile.htm
teognost
03-05-2007, 02:25 PM
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.
kinook
03-05-2007, 06:37 PM
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)]
teognost
03-06-2007, 03:12 AM
It works now,thanks a lot!!!
teognost
06-12-2013, 05:16 AM
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("%CURRBUILD_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" ?
kinook
06-12-2013, 06:52 AM
Probably a) the file is not UTF-16 encoded or b) the email reader can't handle UTF-16 encoded content.
teognost
06-12-2013, 07:20 AM
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
kinook
06-12-2013, 07:43 AM
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.
teognost
06-12-2013, 09:49 AM
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.
䠼䵔㹌䠼䅅㹄䴼呅⁁瑨灴攭畱癩∽潃瑮湥祔数•潣瑮湥㵴琢硥⽴瑨汭※档牡敳㵴呕ⵆ㘱㸢⼼䕈䑁㰾佂奄 ാ㰊ㅈ䈾極摬爠獥汵獴映牯戠極摬㰠牨晥∽瑨灴⼺眯睷欮湩潯潣≭ㄾ⸳⸱ㄱ㜳〮⼼㹡⼼ㅈാ㰊慴汢瑳汹㵥戢 牯敤㩲⌠捤捤捤ㄠ硰猠汯摩∻ാ㰊琯扡敬ാഊ㰊䈯䑏㹙⼼呈䱍ാഊ
kinook
06-12-2013, 12:52 PM
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.
teognost
06-13-2013, 02:24 AM
I did not receive any message from you -which address did u use ?
teognost
06-13-2013, 03:11 AM
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?
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.