Sending UTF-8 from ASP application

Root Folder > Web Hosting
Since we have JMAIL installed on all servers, you may simply use this component and send UTF-8 emails. You may use the sample code and replace yourdomain.com with your own domain name.
<html>
<br>
<head>
<title>UTF-8 Test Email</title>
</head>
 <body>
<p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<%
If Len(Request.Form("txtEmail")) > 0 then<

set msg = Server.CreateOBject( "JMail.Message" )

msg.Logging = true
msg.silent = true
msg.From = info@yourdomain.com
msg.FromName = "Your Company"

msg.AddRecipient Request.Form("txtEmail")

msg.Subject = "Test Mail by JMAIL"

msg.Body = Request.Form("txtBody")
msg.ContentType = "text/plain; charset=UTF-8"
if not msg.Send("127.0.0.1" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
Response.write "Message sent succesfully!"
end if
End If
%>

<form method="post" id=form1 name=form1>
Enter your email address:
<input type="text" name="txtEmail" value="<%=Request.Form("txtEmail")%>">
Body :
<input type="text" name="txtBody" value="<%=Request.Form("txtBody")%>">

<input type="submit" value="Send me an Email with an Attachment!" id=submit1
name=submit1>
</form>


</body>

</html></p>

Add Feedback