Results 1 to 8 of 8

Thread: One issue with creating an HTML-based email

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    29

    One issue with creating an HTML-based email

    So right now I am sending out emails using a distribution list in excel. I do a:
    VB Code:
    1. Set oMessage = CreateObject("CDO.Message")
    to create my mail message and because it is an HTML message I do:

    oMessage.HTMLBody = [html source]

    The Html source I am using was something that was created in an MSOffice AP, probably Word, and then just saved as an HTML file. So I am rote copying the source, but there is one line in there that defines this logo at the top of the page:

    VB Code:
    and I have no idea what that is suppose to be referring to, but I know it gives me a deadlink. If I use some weblink to a graphics it works, so everything about this email is fine, except for that. Does anybody know what that is, and how I can get that logo back in my email. Thank you.

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

    Re: One issue with creating an HTML-based email

    Its a link referring to an embedded image more then likely. You could do like most mailings, use a link to your images on your webserver.
    VB Code:
    1. src="http://www.something.com/images/image001.jpg"
    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
    Junior Member
    Join Date
    Aug 2005
    Posts
    29

    Re: One issue with creating an HTML-based email

    I'll definitely consider doing that, but if I wanted to create an email message of HTML type, is there a way a can link to an embedded image, and also add that embedded image onto my message object? Or is that just not possible (or not possible without jumping through some pretty gnarly hoops)?

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

    Re: One issue with creating an HTML-based email

    I have an example in CodeBank on embedding an image into an email but its using the OOM. You would just need to convert it to CDO if you need it.

    Embedd Image
    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

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    29

    Re: One issue with creating an HTML-based email

    RobDog thanks it worked. I attached the .jpg from a local directory and then I changed the src:"cid:[jpg name]" and it worked, but it is weird like you said. When it is in my outlook mailbox the mail message looks like it has an attachment, and by that I mean it has a paper clip next to it, but then once I open it, the paper clip goes away and it's as if the graphics is a straight up embedded image.

    I don't think I'm going to mess with it much more, but if anybody knows what that is, and if there is a way to get rid of that paper clip, please let me know.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    29

    Re: One issue with creating an HTML-based email

    Just in case anybody cares...like I said above, this addition as noted by robdog did work, even though it had that weird bug I described, but it only works with the windows client. If I checked my email from say hotmail (the web client) then the link is just dead. I guess it can't parse the HTML code correctly. It may be better to just stick with a webserver graphics link, but at least this is an option. Thanks.

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

    Re: One issue with creating an HTML-based email

    I'm back. Been busy. There are 3 types of attachments - ByRef, ByPosition, and embedded. If the attachment is embedded it is still considered an "attachment" by Outlook. Hotmail and other ISPs may do things differently sice theirs is proprietary. Outlooks is by design and is not a bug, just so you dont spend any time trying to remove th epaperclip.
    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
    Junior Member
    Join Date
    Aug 2005
    Posts
    29

    Re: One issue with creating an HTML-based email

    So you're saying outlook is designed to show the paperclip and then make it disappear? I wonder why they wanted to show the paper clip at all, even if just for one time. My other question is if there was a way to choose what type of attachment you want to make? And what type of attachment am I making right now?

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