Microsoft
Software
Hardware
Network
Question : make bold text in email
Hi I have a page which sends emails. I want to make psrt of the body bolf but if I use <strong></strong> it just prints <strong></strong> in the body. Hereis what I have:
messagebody = "The following ENR Classified ad was recieved from " & fromemail & " at " & whensent & vbcrlf & vbcrlf & "<strong>" & title_field & "</strong>" & vbcrlf & editor1
and I want the variable title_field to be in bold. How would I do this. My code is below.
Thanks
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Dim senderemail, recipientemail, subject, messagebody, title_field, editor1, fromemail, whensent
fromemail = request.form("email_field"
)
fromemail = Replace(fromemail, "'", "''")
' EDIT THESE VALUES!!!!
' enter the email address that you want the ads sent to
recipientemail = "
[email protected]
"
'recipientemail = "Angela_Ambrosini@mcgraw-h
ill.com"
' enter the email address that you want to appear in the "from" line of your email
senderemail = "ENRads"
' you can change the text below for the subject line, "fromemail" is a variable not text
subject = "ENR Classified Ads - Online Submission from " & fromemail
' this gets the date and time that the email was sent from the server
whensent = now()
' get the title of the ad from the form page
title_field = request.form("title_field"
)
titlefield = Replace(titlefield, "'", "''")
' get the body of the ad from the form page
editor1 = request.form("editor1")
editor1 = Replace(editor1, "'", "''")
editor1 = Replace(editor1, "<p>", "")
editor1 = Replace(editor1, "</p>", "")
editor1 = Trim(editor1)
' set the content of the email body
messagebody = "The following ENR Classified ad was recieved from " & fromemail & " at " & whensent & vbcrlf & vbcrlf & "*" & title_field & "*" & vbcrlf & editor1
' these are used for testing purposes they can be deleted
response.write (senderemail) & "<br>"
response.write (recipientemail) & "<br>"
response.write (subject) & "<br>"
response.write (messagebody)
' send the first email to us
Set myMail=CreateObject("CDO.M
essage")
myMail.Subject=subject
myMail.From=senderemail
myMail.To=recipientemail
myMail.TextBody=messagebod
y
myMail.Configuration.Field
s.Item _
("
http://schemas.microsoft
.com/cdo/c
onfigurati
on/sendusi
ng
")=2
'Name or IP of remote SMTP server
myMail.Configuration.Field
s.Item _
("
http://schemas.microsoft
.com/cdo/c
onfigurati
on/smtpser
ver
") _
="mail.glowfishtw.com"
'Server port
myMail.Configuration.Field
s.Item _
("
http://schemas.microsoft
.com/cdo/c
onfigurati
on/
smtpser
verport
") _
=25
myMail.Configuration.Field
s.Update
myMail.Send
set myMail=nothing
' change the email body message with an added thank you message for the user
messagebody = "Thank you for your submission to ENR Classifieds. Below is the text from your ad. We will contact you if we need any other information." & vbcrlf & "Thank you." & vbcrlf & vbcrlf & messagebody
' sned a second copy of the email to the user
Set myMail2=CreateObject("CDO.
Message")
myMail2.Subject= subject
myMail2.From=senderemail
myMail2.To=fromemail
myMail2.TextBody=messagebo
dy
myMail2.Configuration.Fiel
ds.Item _
("
http://schemas.microsoft
.com/cdo/c
onfigurati
on/sendusi
ng
")=2
'Name or IP of remote SMTP server
myMail2.Configuration.Fiel
ds.Item _
("
http://schemas.microsoft
.com/cdo/c
onfigurati
on/smtpser
ver
") _
="mail.glowfishtw.com"
'Server port
myMail2.Configuration.Fiel
ds.Item _
("
http://schemas.microsoft
.com/cdo/c
onfigurati
on/
smtpser
verport
") _
=25
myMail2.Configuration.Fiel
ds.Update
myMail2.Send
set myMail2=nothing
%>
<html>
<head><title>Send Email for enr_ads</title></head>
<body>
<%
' redirect to the form page with a url variable added to display the thank you message
Response.Redirect "enr_ads.asp?resp=x"
%>
</body>
</html>
Answer : make bold text in email
i think you only need to change
myMail.TextBody=messagebod
y
to
myMail.HTMLBody=messagebod
y
Random Solutions
Iphone Can't get Exchange mail on LAN but ok on 3G.
compareTo() - JavaScript example needed
Resize multi select boxes in SharePoint form
Hidden answers after logging in
Link to PDF files from DVD Menu
VBA to rename an MS Word dropdown formfield.
stop Weblogic managed server without node manager and admin server
How to retrieve data from an XML file using ASP.NET?
troubleshooting easy vpn remote
Sharing Access File