SMTPMAIL Format & File Link??

  • Thread starter Thread starter B-Dog
  • Start date Start date
B

B-Dog

I've built a form that I want to use to email some of the information off it
to a few users which will include a link to a folder on our network. I'm
trying to send it in html format but when the message is received all you
see is the html code and not just the text. I've included the code below
but I'm a rookie so I must be missing something or doing something wrong.
Thanks!

Barclay

Sub sendmail()

Dim email As MailMessage = New MailMessage

Dim stringMessage As String

Dim uName As String

uName = "(e-mail address removed)"

'message string with link

'stringMessage = "<BODY>Click the link below to open directory<A
href=""file://z:\pending move\" & TextBox1.Text & "\"">file://z:\pending
move\& textbox1.text & ""\</A> </BODY>"

stringMessage = "<html><body>UtilMailMessage001->success</body></html>"

email.BodyFormat = MailFormat.Html

SmtpMail.SmtpServer = "mail.domain.net"

SmtpMail.Send(uName, "(e-mail address removed)", "New Files Ready to be Archived in
folder: (" & TextBox1.Text & ")", stringMessage)

End Sub
 
Thanks for the help, I had some of my quotes screwed up.

Jenni Parks said:
Try this:

Dim newMail As New MailMessage

newMail.From = MailFrom
newMail.To = MailTo
newMail.Subject = Subject
newMail.BodyFormat = MailFormat.Html
newMail.Body = "<html><head><title>" & Subject & "</title></head><body>" &
Message & said:
SmtpMail.Send(newMail)

Also make sure the mail server you are sending through and the destination
mail server support html email.
 
Back
Top