vbSendMail and MIME Types


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: vbSendMail and MIME Types

  1. #1
    Join Date
    Mar 2009
    Posts
    3

    vbSendMail and MIME Types

    I have been trying to send HTML email using vbSendMail.dll along with Microsoft Access 2003 and VBA. My code is fairly complex, but I know it is not the problem.

    I have the asHTML property set, but HTML email can only be delivered inside my own domain. I've talked with domain tech support and they say that my HTML emails need to have multipart MIME encoding, or they at least need to have a text/plain MIME part inside them.

    Without this, the spam filter on the server scores my messages higher, and blocks them from being delivered. Tech support isn't willing to change this, so I need to work around it at my end.

    I haven't got a clue how to do this. Is there any way to get vbSendMail to send multipart MIME messages?

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Mar 2009
    Posts
    3

    More Questions...

    Thanks, I did try MHTMLBody and managed to set it up and get it working in my code, but I could not tell if a text/plain segment was included in any of the test messages. I use Outlook 2002 to receive my test messages. What I saw was that the type changed from "text/html" into "multipart/related".

    That got me to look again at CDO, and I think that's the direction I'll be heading in the near future. VbSendMail was a convenient choice, but it doesn't handle the MIME encoding I need.

    Unfortunately, that leads to an entirely different question:

    It's nice that the HTML works and all, but I don't think I will be able to get it to my list's recipients unless I can create MIME encoded messages that contain both a text/plain segment and a text/html segment.

    Is there any way to do this with CDO?
    Last edited by CoderOSU; 03-24-2009 at 05:35 PM. Reason: Adding detail

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    This looks to me like it might have possibilities...

    http://objectmix.com/microsoft-excha...o-message.html
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Mar 2009
    Posts
    3

    Smile Thanks!

    This looks to me like it might have possibilities...

    http://objectmix.com/microsoft-excha...o-message.html
    It took a little bit of doing, but I got the text stream up and running. I ran into the exact same problem that one of the users had on the other forum: the text stream wouldn't go away when looping through a list of subscribers. Each message that I sent had all of the earlier messages stuck onto it.

    I found that I could safely discard each mail message (I called the message variable cdoMail) after it was sent. I put this at the end of my loop:

    Code:
      ' Gets rid of the previous message before sending another one...
      Set cdoMail = Nothing
      ' Creates a new message so that the system can use it...
      Set cdoMail = CreateObject("CDO.Message")
    Next intMessage
    Now everything's running smoothly!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center