Format E-mail

Discussion in 'ASP General' started by JN, Jul 14, 2003.

  1. JN

    JN Guest

    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.
    JN, Jul 14, 2003
    #1
    1. Advertising

  2. Post your code? It looks like you are sending it as plain text ...


    "JN" <> wrote in message
    news:...
    > 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.
    >
    >
    John McDermidt, Jul 14, 2003
    #2
    1. Advertising

  3. This article details ways to send HTML formatted e-mail.

    http://www.aspfaq.com/2295





    "JN" <> wrote in message
    news:...
    > 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.
    >
    >
    Aaron Bertrand - MVP, Jul 14, 2003
    #3
  4. JN

    Ray at Guest

    What object are you using? CDO? CDONTS? Some third party object?

    Ray at home

    "JN" <> wrote in message
    news:...
    > 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.
    >
    >
    Ray at, Jul 14, 2003
    #4
  5. JN

    JN Guest

    I did post the relevent code. I am formatting it in the H1 assignment then
    sending it.

    "John McDermidt" <jmcdt73_at_msn.com> wrote in message
    news:%...
    > Post your code? It looks like you are sending it as plain text ...
    >
    >
    > "JN" <> wrote in message
    > news:...
    > > 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.
    > >
    > >

    >
    >
    JN, Jul 14, 2003
    #5
  6. JN

    JN Guest

    It's a 3rd party object, VB DLL on backend creating a Mail Object via an ASP
    page.


    "Ray at <%=sLocation%>" <> wrote in message
    news:ul6C$...
    > What object are you using? CDO? CDONTS? Some third party object?
    >
    > Ray at home
    >
    > "JN" <> wrote in message
    > news:...
    > > 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.
    > >
    > >

    >
    >
    JN, Jul 14, 2003
    #6
  7. The relevant code would be where your ASP calls the object.

    "JN" <> wrote in message
    news:...
    > I did post the relevent code. I am formatting it in the H1 assignment then
    > sending it.
    >
    > "John McDermidt" <jmcdt73_at_msn.com> wrote in message
    > news:%...
    > > Post your code? It looks like you are sending it as plain text ...
    > >
    > >
    > > "JN" <> wrote in message
    > > news:...
    > > > 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.
    > > >
    > > >

    > >
    > >

    >
    >
    John McDermidt, Jul 14, 2003
    #7
  8. > I did post the relevent code.

    No, you didn't.
    Aaron Bertrand - MVP, Jul 14, 2003
    #8
  9. > It's a 3rd party object,

    WHICH ONE? There are only about 100 3rd party e-mail com objects...
    Aaron Bertrand - MVP, Jul 14, 2003
    #9
  10. JN

    Ray at Guest

    The name of it? Did you check the documentation for it?

    Ray at work

    "JN" <> wrote in message
    news:...
    > It's a 3rd party object, VB DLL on backend creating a Mail Object via an

    ASP
    > page.
    Ray at, Jul 14, 2003
    #10
  11. JN

    JN Guest

    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 = ""
    End If
    StrTo = ""

    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

    %>




    "John McDermidt" <jmcdt73_at_msn.com> wrote in message
    news:ODtMp%...
    > The relevant code would be where your ASP calls the object.
    >
    > "JN" <> wrote in message
    > news:...
    > > I did post the relevent code. I am formatting it in the H1 assignment

    then
    > > sending it.
    > >
    > > "John McDermidt" <jmcdt73_at_msn.com> wrote in message
    > > news:%...
    > > > Post your code? It looks like you are sending it as plain text ...
    > > >
    > > >
    > > > "JN" <> wrote in message
    > > > news:...
    > > > > 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.
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    JN, Jul 14, 2003
    #11
  12. JN

    JN Guest

    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.

    "Ray at <%=sLocation%>" <> wrote in message
    news:%23a%23$...
    > Did you check the documentation for this aspmailer.smtp object to see if
    > there is an htmlbody property you have to set or something along those
    > lines?
    >
    > Ray at work
    >
    > "JN" <> wrote in message
    > news:...
    > > Here is the code:
    > >
    > > '~~~~~~~~~~~ Send to Emails ~~~~~~~~~~~

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

    >
    >
    JN, Jul 14, 2003
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Curt_C [MVP]
    Replies:
    5
    Views:
    355
    Karim
    May 19, 2004
  2. me
    Replies:
    0
    Views:
    430
  3. =?Utf-8?B?TXJGZXo=?=

    Mail message size problem (System.Web.Mail)

    =?Utf-8?B?TXJGZXo=?=, Mar 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    627
    =?Utf-8?B?TXJGZXo=?=
    Mar 14, 2005
  4. =?Utf-8?B?TWlja2VCb3k=?=

    Problem with System.Web.Mail.MailMessage and HTML mail

    =?Utf-8?B?TWlja2VCb3k=?=, Jun 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    894
    =?Utf-8?B?TWlja2VCb3k=?=
    Jun 21, 2005
  5. John Dalberg
    Replies:
    1
    Views:
    2,588
    =?Utf-8?B?U2l2YSBN?=
    Sep 19, 2005
Loading...

Share This Page