Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > VBA - send email using CDO and Exchange

Thread Tools Display Modes
Old 07-29-2009, 09:50 AM
pstirek pstirek is offline
Join Date: Jul 2009
Posts: 1
Default VBA - send email using CDO and Exchange

Hi all,
I have a problem with sending emails from VBA through remote Exchange server (in LAN). Previously I used remote SMTP server and everything was working fine, but now I changed few parameters to use Exchange instead and I'm facing the problem.

Here is my code (completely based on Microsoft refernence pages):

Dim Msg, Config
Set Msg = CreateObject("CDO.Message")
Set Config = CreateObject("CDO.Configuration")
Set Config = Msg.Configuration

Config("http://schemas.microsoft.com/cdo/configuration/sendusing") = 3
Config("http://schemas.microsoft.com/cdo/configuration/mailboxurl") = sMailboxURL

Msg.To = sTo
Msg.From = sFrom
Msg.Subject = sSubject
Msg.TextBody = sText


Set Msg = Nothing
Set Config = Nothing
The error occurs on line "Config.Fields.Update":
No.: 3749
Description: Fields update failed. For further information, examine the Status property of individual field objects.
Status of field 'Sendusing' = 262155

Does anyone know what is the problem? I can't find better detail of the error. Also I tried to use several forms in mailbox address but the result is still the same.

I would appreciate any help or hint.

Many thans,
Reply With Quote
Old 07-30-2009, 12:00 PM
emartinho emartinho is offline
Join Date: Jan 2009
Location: Toronto, Ontario
Posts: 194

Seems to me that the value you're putting in the Sendusing configuration parameter is invalid.
From what I could find on MSDN (http://msdn.microsoft.com/en-us/libr...EXCHG.10).aspx), there's only 2 options for SendUsing:
1 - SendUsingPickup
2 - SendUsingPort

Therefore the value 3 would cause an error. Whether that error is helpful or not...., well, we all know how Microsoft's errors "help" don't we?

Hope this helps.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..