Format E-mail

J

JN

Hello,

I use an ASP mail object to send orders filled online to a recipient via an
e-mail. I would like to know if it's possible to format the way the order
looks in an e-mail? I tried the following, but see no change in the format:

H1 = "<b><font size=2 color=#ED171F face=Verdana, Arial, Helvetica,
sans-serif>Order Type:</font></b>"

StrBody = H1 + Request(OrderNum) + vbCrLf

Then I get Order Type: just as plain as it would come if it didn't have any
formatting.

If I do the following:

StrBody = "<b>Order Type:</b> + Request(OrderNum) + vbCrLf

Then I get <b>OrderType:</b> as the heading.

Does anyone know if it's possible to format the way the text look in an
e-mail that is sent using the ASP Mail Object? Is there a different way of
controlling the format/appearance of the text that appears in an e-mail?

Thanks for your help.
 
A

Aaron Bertrand - MVP

It's a 3rd party object,

WHICH ONE? There are only about 100 3rd party e-mail com objects...
 
J

JN

Here is the code:

'~~~~~~~~~~~ Send to Emails ~~~~~~~~~~~

If Len(Request.Form("submit1")) > 0 Then
'--|Send Clicked, Send E-mail
Dim oMail
Dim StrServerName
Dim StrTo
Dim StrFrom
Dim StrSubject
Dim StrBody


On Error Resume Next

Set oMail = Server.CreateObject("aspmailer.smtp")

'--|Trap for unregistered component
If Err.Number = -2147221005 Then
Response.Write "The component needs to be registered on the server!"
Response.End
End If

'--|Specify the SMTP server here (MAIL01)
StrServerName = "MAIL01"

'--|Check for null from in case you want a generic mailer account to send
email
If Len(Request("OrderConfEmail")) > 0 then
StrFrom = Trim(Request("OrderConfEmail"))
Else
StrFrom = "(e-mail address removed)"
End If
StrTo = "(e-mail address removed)"

CustName = "Modify an Existing Order for " & Trim(Request.Form("buyer"))
IF (Request("RNewUpdate") = "RNew") THEN
StrSubject = "New Order"
Else
StrSubject = "Update an Existing Order for #" & Request("UpdInvnum")
End If

'Format order sent via e-mail, i.e. bold the heading, etc.
H1 = "<b><font size=2 color=#ED171F face=Verdana, Arial, Helvetica,
sans-serif>Order Type:</font></b>"

StrBody = H1 + Request("ROrderComRes") + vbCrLf + _
"Closing Location: " + Request("RClosingLoc")

'--|Try to send it
bReturn = oMail.sendmail( StrServerName, StrTo, StrFrom, StrSubject,
StrBody )

If bReturn Then

Response.Write "<p><img border=0 src=images/logo2.gif width=291
height=47></p>" & _
"<p align=center><font size=4 color=#3C3C3C face=Arial, Helvetica,
sans-serif>Online Order Confirmation</font></p>" & _
"<hr color=#3B5C8D>" & _
"<p align=left><font size=3 color=#3C3C3C face=Arial, Helvetica,
sans-serif>Thank you for submitting your order with us. If the information"
& _
" we received is complete, your order shall receive immediate
attention.
</font></p>" & _
"<hr color=#3B5C8D><br>" & _
"<script lanquage=JavaScript src=footer.js>" & _
"</script>"

Else
'--|Show the error message also
Response.Write "<html><head><title>Error!</title></head><body>" & _
"There was a problem, Order was not sent!<br>" & _
oMail.status 'Show error
Response.Write "</body></html>"
End If

Set oMail = Nothing

Else
'--|Show Email form

%>
 
J

JN

There was no documentation, as I got this via a subscription with a
developer resource site. They are undergoing re-construction so I can't find
the same application again. There only were comments in the application,
which doesn't say anything about HTML format or formatting the e-mails.
Perhaps, I could modify the VB project/dll and add a htmlbody property.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top