Send e-mail with CDO

G

Guest

Hi! I have a macro in excel that was working to send e-mail. But when i
upgraded the office from 2002 to office 2003, the code stop working. On the
instruction: Config.Fields.Update i got the error: "Fields update failed. For
further information, examine the Status property of individual field objects.
" Err: 3749 Status: 262155 (Field Sendusing) Anybody knows if i have to
update any component? Apparently, there is some problem with the method
cdoSendUsingExchange. If i change to cdoSendUsingPickup or cdoSendUsingPort
the error will not work. But i have to send through exchange. Thanks in
advance.

Const cdoSendUsingMethod =
"http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoMailBox = "http://schemas.microsoft.com/cdo/configuration/mailboxurl"
sMailboxURL = "http://servidor/exchange/XXXXXX/Caixa de saída/"

' Create message and configuration objects.
Set Msg = CreateObject("CDO.Message")
Set Config = CreateObject("CDO.Configuration")
' Get the message configuration object.
Set Config = Msg.Configuration
' Set the sendusing field to 'cdoSendUsingExchange'.
Config(cdoSendUsingMethod) = 3
' Set the mailboxurl field to the specified mailbox URL.
Config(cdoMailBox) = sMailboxURL
' Update the fields.
Config.Fields.Update
' Set the To, From, Subject, and TextBody fields on the message.
Msg.To = pstrDestinatario
Msg.FROM = "teste@@teste.com.br"
Msg.Subject = pstrAssunto
Msg.HTMLBody = pstrMensagemHtml
Msg.Send
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top