If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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?

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.

Thanks!

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