After you sent the Message you can use its various properties to compose the
content to save in a file that looks like the email you sent:
Private Sub WriteEmailToAFi le( _
ByVal Message As System.Web.Mail .MailMessage, _
ByVal strFilePath As String)
Dim sw As System.IO.Strea mWriter = _
New System.IO.Strea mWriter(strFile Path)
sw.Write("<html ><head></head><body>")
sw.Write("<p>Da te: " & Now.ToLongDateS tring & _
" @ " & Now.ToLongTimeS tring & "</p>")
sw.Write("<P>To :" & Message.To & "</p>")
sw.Write("<p>Fr om: " & Message.From & "</p>")
sw.Write("<p>Su bject: " & Message.Subject & "</p>")
sw.Write("<div> Body: " & Message.Body & "</div>")
sw.Write("</body></html>")
sw.Close()
End Sub
--
HTH,
Phillip Williams
http://www.societopia.net http://www.webswapp.com
"Marc Hoeijmans" wrote:
Hi,
We like to save the emails we send as textfile on a file server. I want to
use the System. Web.Mail class for sending the email. The question is how can
i save the message as file. I have tried to use the msgMail.ToStrin g() method
but this won't help, or i have to type cast te MailMessage as a string, but i
donýt know how to do this.
Thanks,
Marc