I've been searching around for a few weeks trying to find a "for idiots" tutorial on how to use CDOEX, as all I want to do is send a simple e-mail. I'm developing an intranet application for a company that uses active directory and exchange server (I think 2000), and all I need to do is send simple email messages. The problem I seem to be having is that I can't figure how to find the URL for a user's mailbox. The code I'm using is:
Code:
submit = Request.Form.Item("B1")
if submit = "Send" then
Dim iMsg
'Create the message object
Set iMsg = CreateObject("CDO.Message")
Dim iConf
'Create the configuration object
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
'Set the fields of the configuration object to send using exchange server
Set Flds = iConf.Fields
Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 3
Flds.Update
'Set the message to,from,subject,body properties.
Set iMsg.Configuration = iConf
iMsg.To = Request.Form.Item("Text1")
iMsg.From = "<my email address>"
iMsg.Subject = Request.Form.Item("Text3")
iMsg.TextBody = Request.Form.Item("TextArea1")
iMsg.Send
end if
Using that code, I get this error:
Error Type:
CDO.Message.1 (0x80040233)
Could not find the Sender's mailbox.
/NewMail.asp, line 24
Line 24 is the .Send command.
How can I find a user's mailbox, given their logon name, domain, and email address?