Freigeben über


Msbuild Send Email SMTP Server

<

Project xmlns="https://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="EmailIt">

<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />

<

PropertyGroup >

<

MsgFailed>Failed Email for </MsgFailed>

<

MsgSuccess>success Email for </MsgSuccess>

</

PropertyGroup>

<Target Name="EmailIt" >

<Email MailTo="abc@ms.com"

MailFrom="sundar@ms.com"

SmtpServer="EmailSMTPServer.ms.com or Ip address of the server"

Subject=" Build status Today"

Body="Hi All,&lt;BR/&gt;

Today’s Daily Build and Deployment Completed:

&lt;BR/&gt;&lt;BR/&gt;

Format="HTML"

Attachments="$(ResultsItem)$(BuildLogZip)"

/>

<OnError ExecuteTargets ="HandleErr"/>

</Target>

<Target Name="HandleErr" >

<Message Importance ="high" Text ="$(MsgFailed) : " ContinueOnError ="true" ></Message>

</

Target>

</

Project>

Comments