Sending Mail

I am doing a program (Sending email). I reference this function from Mark Hughes blogspot.

In this case, I can send the mail but , i can’t put the variable value in setHearderVal. I can put only the static string. It is like that. How should i put?

body = doc1.createMIMEEntity()

subject = body.createHeader(“Subject”)

subject.setHeaderVal(“subject”)

stream = session.createStream()

stream.writeText(“totalvalue”)

body.setContentFromText(stream, “text/html; charset=iso-8859-1”, 0)

doc1.send(“group or persons name”)