View Full Version : Garbled text sending email with SMTPsvg

04-26-2006, 01:29 AM
I'm trying to get a simple email form page to work on a Japanese version of a website. Everything works great, but Japanese text entered into any of the fields when emailed comes back all garbled.

I thought it would be an encoding type problem but my charset is UTF-8 for everything on the page. A watered down version of the code is below. Any ideas what would be causing the text to change when emailed?

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.ContentType = "text/html"
Mailer.CustomCharSet = "UTF-8"
Mailer.Subject = Mailer.EncodeHeader(Request.Form("subject"))

'start the message body
strMsgHeader = "<html><head></head><body>"
strMsgInfo = strMsgInfo & "Name: " & Request.Form("name") & "<br>"
strMsgInfo = strMsgInfo & "Email: " & Request.Form("email") & "<br>"
strMsgInfo = strMsgInfo & "User Message: " & Request.Form("message") & "<br>"
strMsgInfo = strMsgInfo & "---------------------" & "<br>"
strMsgFooter = "</body></html>"

Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

if Mailer.SendMail then
msgSent = true
msgSent = false
end if

Thanks for any help.