Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

make bold text in email

Posted on 2010-08-24
2
Medium Priority
?
536 Views
Last Modified: 2013-12-18
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 = "elliottbenzle@gmail.com"
'recipientemail = "Angela_Ambrosini@mcgraw-hill.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.Message")
myMail.Subject=subject
myMail.From=senderemail
myMail.To=recipientemail
myMail.TextBody=messagebody
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="mail.glowfishtw.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.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=messagebody
myMail2.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail2.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="mail.glowfishtw.com"
'Server port
myMail2.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail2.Configuration.Fields.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>


0
Comment
Question by:elliottbenzle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
roarkinc earned 2000 total points
ID: 33513762
i think you only need to change
myMail.TextBody=messagebody

to

myMail.HTMLBody=messagebody
0
 
LVL 4

Author Closing Comment

by:elliottbenzle
ID: 33513932
Thanks. That was all I needed.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question