Results 1 to 9 of 9

Thread: HTML Email

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    HTML Email

    Hi,
    When I receive certain emails they appear as a webpage i.e HTML formatted text and graphics images etc. How do I send emails the same?

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: HTML Email

    I am awake now.

    If you mean manually then if your using Outlook you can change your settings in the Options > Mail Format > Message Format > "Compose in this message format:" > and choose HTML.

    If you mean programmatically I can post the code too but I think you may mean manually.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: HTML Email

    I have changed the settings to be html but where do I place the html code?
    If I type it directly into the message body it doesnt display as rendered html when received by a recipient its still just code!
    What I am trying to do is send emails that appear as webpages.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: HTML Email

    For that ot happen the receipient must be able to view their emails as HTML too. When you type into the body it will be like using FrontPage or any WYSIWYG editor.

    I have some code on the forums for this let me search for it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: HTML Email

    Couldnt find it. What version of Outlook are you using? I will write up something quickly.

    Meanwhile this is a link for Outlook 2000 and before.

    http://msdn.microsoft.com/library/de...roHTMLBody.asp
    Last edited by RobDog888; Nov 22nd, 2005 at 03:42 PM.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: HTML Email

    Hi Rob,
    I think its just me being stupid but if I set the message to be of type HTML
    and in the message paste
    <HTML>
    <BODY BGCOLOR="RED">
    <B>HTML EMAIL</B>
    </BODY>
    </HTML>

    should it not display as a html page, (I guess not because I tried it) but thats what Im wanting to do, design an email that displays like a wepage in outlook through code.

    PS Im using Outlook express which I got free with XP, but I know its capable of displaying these emails because thats how most spam I receive is displayed.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: HTML Email

    Here is a quick and dirty demo.
    VB Code:
    1. Option Explicit
    2. 'Add a reference to MS Outlook xx.0 Object Library
    3. Private moApp As Outlook.Application
    4.  
    5. Private Sub Command1_Click()
    6.     Dim oEmail As Outlook.MailItem
    7.     Dim strBody As String
    8.    
    9.     Set oEmail = moApp.CreateItem(olMailItem)
    10.     strBody = "<HTML><HEADER><TITLE>RobDog888 HTML Email DEMO</TITLE></HEAD>"
    11.     strBody = strBody & "<BODY bgcolor='green'>Testing</BODY></HTML>"
    12.     With oEmail
    13.         .BodyFormat = olFormatHTML
    14.         .HTMLBody = strBody
    15.         .Subject = "RobDog888 HTML DEMO"
    16.         .Save 'Saves it to the Drafts folder
    17.         .Display
    18.     End With
    19. End Sub
    20.  
    21. Private Sub Form_Load()
    22.     Set moApp = New Outlook.Application
    23. End Sub
    24.  
    25. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    26.     moApp.Quit
    27.     Set moApp = Nothing
    28. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: HTML Email

    Thanks I see what is happening there in vb code, but is there no way to just type HTML direct into an email through Outloook?

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: HTML Email

    I suppose you could change your options. Option > Mail Format > Use Word to edit emails, but thats still a WYSIWYG editor.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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