<p>I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is.  </p>

<p>Here's the scenario,
I have a text file output of an "sc" command. I want to send that file but not as an attachment.  Also, I want to see the initial status quickly in the subject of the email.</p>

<p>Here's the 'servstop.txt' file contents:</p>

<blockquote>
  <p>[SC] StartService FAILED 1058:</p>
  
  <p>The service cannot be started, either
  because it is disabled or because it
  has no enabled devices associated with
  it.</p>
</blockquote>

<p>I want the subject of the email to be "Alert Service Start: [SC] StartService FAILED 1058"
and the body to contain the entire error message above.</p>

<p>I will put my current method in an answer below using a program called blat to send me the result.</p>

If the
```
<loner>
```
element in your sample XML didn't have the
```
xmlns
```
default namespace declaration on it, then it would be in the
```
whatever:name-space-1.0
```
namespace rather than being in no namespace. If that's what you want, you need to create the element in that namespace:
```
```
xml.CreateElement("loner", "whatever:name-space-1.0")
```
```
If you want the
```
<loner>
```
element to be in no namespace, then the XML that's been produced is exactly what you need, and you shouldn't worry about the
```
xmlns
```
attribute that's been added automatically for you.