Send email from Access 2013 through external SMTP server?

ComicBookGuy

Registered User.
Local time
Today, 15:41
Joined
Mar 5, 2014
Messages
30
Hi,
I have Access 2013, Win 7, Outlook 2010 (32-bit).

I want to send an email from Access, but not through Outlook. Instead I want to connect to an external SMTP server. I've found a few examples that doesn't work for me.
With code including for example
Code:
Set ObjMessage = CreateObject("CDO.Message")
I get an "Error 429: Object can't be created in Active X-component" (My translation from Swedish).

With code including this:
Code:
Dim oEMail As New CDONTS.EMail
I get "user defined type has not been defined" (my translation again).

I have working code for sending email through Outlook, which works fine. But, Outlook adds a lot of span tags, making it impossible to read for certain screen readers used by visually impaired people, therefore I can't use Outlook.

I've tried to read up on the matter (CDO), and think that maybe the CDO library etc is not included on my computer? Is this correct? In that case, can I download it? Or is the problem something else?

Thankful for any pointers.
Martin
 
You need to add the reference to the Microsoft CDO for Windows 2000 Library. In the VBA editor you'll find it under Tools > References.

And I wonder what problems you were encountering with Outlook?
 
Thanks, I'll try that.

The problem with Outlook is that it every now and then destroys the formatting of the html email. It is not visible to me, as a seeing person, but makes email virtually unreadable for visually impaired readers using screen readers.
Seems like Outlook (sometimes) gets confused by the special letters in Swedish, Å Ä and Ö. Instead of this (in swedish):
Code:
<span>På lördag åker äventyrare ut på äventyr</span>
We get this:
Code:
<span>P</span>å<span> l</span><span>ö</span><span>rdag </span><span>å</span><span>ker </span><span>ä</span><span>ventyrare ut p</span><span>å</span><span> ä<span>ventyr</span>
This gets chopped up by the screen readers. unreadable. Well, if you don't understand Swedish both examples are unreadable :)

Since we have to include clickable links in the email, I can't use Unformatted text-format.

I'd be happy to solve this Outlook-problem instead of the external SMTP-problem.
 
Well, if you don't understand Swedish both examples are unreadable :)
That's my position :)

I'd be happy to solve this Outlook-problem instead of the external SMTP-problem.
You want to look for an Outlook VBA forum, ask your question there and the Outlook experts will (hopefully) have a solution for you. I suspect it's a matter of preserving the unicode format between conversions.
 
Hi again, I can't find Microsoft CDO for Windows 2000 Library in my list. Scrolling through the long list, I couldn't find anything with CDO.
The active references are:
Visual Basics For Applications
Microsoft Access 15.0 Object Library
OLE Automation
Microsoft Access 15.0 Access database engine Object Library

Thanks,
Martin
 
That's my position :)

You want to look for an Outlook VBA forum, ask your question there and the Outlook experts will (hopefully) have a solution for you. I suspect it's a matter of preserving the unicode format between conversions.

Sorry, didn't see this answer until now. That sounds interesting, I'll look into that, thanks!

Martin
 
I would advise that you look through once more, it usually comes as default. But if you can't find it then the chance of your users not having it is also high.

The dll is called cdosys.dll
 
Which exact steps do you undertake in preparation of these mails in/for Outlook?

Make an experiment: prepare .HTMLbody = "your full html page written exactly as it should be incl. html and Swedish characters" and see whether Outlook massacres that too, or leaves it alone.
 
He spikepl, thanks for the suggestion. That does seem to work.

As long as I don't edit anything in the Outlook mail, the html stays the same. But, the very second I edit the mail (in Outlook), it adds literally hundreds of lines of code. Even if I just add a blank space. That's what you get for using MS Word as html editor, as Outlook 2010 does.

Not sure if I can scare the end users enough to not even add a blank space in Outlook, but it does work. Thanks!
 
Thinking out loud now, but if I use .Send instead of .Display as I do now, the end users won't get a chance to mess it up. I think this is solved! Thanks!
 

Users who are viewing this thread

Back
Top Bottom