Results 1 to 10 of 10

Thread: Formating Email Message

  1. #1

    Thread Starter
    Fanatic Member Jumpercables's Avatar
    Join Date
    Jul 2005
    Location
    Colorado
    Posts
    592

    Formating Email Message

    I am sending an email message via the Shell Command. However I want to make some of the text bold or underlined with other parts regular text.

    I have tried the following but it doesn't seem to be working
    VB Code:
    1. Dim strMessage As String
    2.  
    3. strMessage = "[b]THIS IS BOLD[/b]" & vbCrLf
    4. strMessage = strMessage & "[u]THIS IS UNDERLINED[/u]" & vbCrL
    5. strMessage = strMessage & "This is normal" & vbCrL
    6.  
    7. blnSuccess = Email(&H0, strTo, "TESTING", strMessage)

    However when I try to this technique I just get all the text out instead of the Bold or Underlined works. I have the emailer set to HTML.

    Any ideas if this is possible. Thanks

    C# - .NET 1.1 / .NET 2.0

    "Take everything I say with a grain of salt, sometimes I'm right, sometimes I'm wrong but in the end we've both learned something."
    _____________________
    Regular Expressions Library
    Connection String
    API Functions
    Database FAQ & Tutorial

  2. #2
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: Formating Email Message

    Try surround the bold text with <b>
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  3. #3

    Thread Starter
    Fanatic Member Jumpercables's Avatar
    Join Date
    Jul 2005
    Location
    Colorado
    Posts
    592

    Re: Formating Email Message

    I have tried both [] and <> however when the email message is opened it just has "<b>THIS IS BOLD</b> or THIS IS BOLD" and same for underlining.

    C# - .NET 1.1 / .NET 2.0

    "Take everything I say with a grain of salt, sometimes I'm right, sometimes I'm wrong but in the end we've both learned something."
    _____________________
    Regular Expressions Library
    Connection String
    API Functions
    Database FAQ & Tutorial

  4. #4
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: Formating Email Message

    I seem to remember that you need to add a header to specify that the email is in HTML, and then use <b>bold text here</b>.

    Search google for sending HTML emails and you should find something
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  5. #5
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: Formating Email Message

    I did some investigating and it should work if you add this to the top of your email
    Code:
    Content-Type: text/html; charset=ISO-8859-1
    and then use <b>This is bold text</b>

    [Edited by MartinLiss]
    Last edited by MartinLiss; Jul 14th, 2006 at 11:45 AM.
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Formating Email Message

    How the email appears to the receiver depends on the client the email is being viewed in. A POP3 client (a bare client, not one calling Word to view files) will see [b]text[/b] as [b]text[/b], not as text - since email is specified as a text medium - characters only. In order to have text appear bold to the receiver, you have to know whether the receiver can read html email (which is an oxymoron).
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  7. #7
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: Formating Email Message

    [b] is BBCode which is why it won't work in an email, it only works in certain forums.
    <b> is HTML, which is supported by just about all clients, so if you include the header that I gave you above it will work fine
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  8. #8

    Thread Starter
    Fanatic Member Jumpercables's Avatar
    Join Date
    Jul 2005
    Location
    Colorado
    Posts
    592

    Re: Formating Email Message

    I will give a try in a few minutes when I have a chance an let you know.

    C# - .NET 1.1 / .NET 2.0

    "Take everything I say with a grain of salt, sometimes I'm right, sometimes I'm wrong but in the end we've both learned something."
    _____________________
    Regular Expressions Library
    Connection String
    API Functions
    Database FAQ & Tutorial

  9. #9
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: Formating Email Message

    Did it work?
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Formating Email Message

    Quote Originally Posted by shirazamod
    [b] is BBCode which is why it won't work in an email, it only works in certain forums.
    <b> is HTML, which is supported by just about all clients
    All clients that default to reading html, which is fewer and fewer as the exploits increase. One of these days people are going to start realizing that Microsoft's errors don't redefine internet RFCs.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width