Sending a mail from IIS 5.1 on XP Pro

Sending a mail from IIS 5.1 on XP Pro

Post by Peder K. J » Wed, 10 Dec 2003 23:50:07


I want to send a mail from the ASP-script to the user, but
so far I have no success in logging on the Virtuel SMTP-
Server (IIS 5.1 on Windows XP Professional). I have tried
to use the CDO 1.2.1 library.

The code in VBScript looks like this:
<%
Set objSession= CreateObject("MAPI.Session")
objSession.Logon
%>

Creating the Session-object is succesfull, but the logon
(which must be an anonymous logon) fails with this error
type:
Collaboration Data Objects (0x4F9)
[Collaboration Data Objects - [MAPI_E_LOGON_FAILED
(80040111)]].

The logon function has a lot of optional parameters, which
I have tried in different combinations without any luck.

As an alternative: Does there exist a pendant to
the "CDONTS.NewMail"-object in CDO 1.2.1?
 
 
 

Sending a mail from IIS 5.1 on XP Pro

Post by Dmitry Str » Thu, 11 Dec 2003 02:49:57

Se the last parameter in Session.Logon to the name of the server and the
mailbox name separated by the carriage return.

Dmitry Streblechenko (MVP)
http://www.yqcomputer.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

 
 
 

Sending a mail from IIS 5.1 on XP Pro

Post by Peder K. J » Thu, 11 Dec 2003 04:04:38

Thanks for your reply, but it brings me another error type:
Collaboration Data Objects (0x4F7)
[Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]]

My code now looks:
<%
Set objSession= CreateObject("MAPI.Session")
objSession.Logon ,,,,,,"myComputer.myDomain.dk" & vbLf &
vbLf & "anon"
%>

The reference in MSDN for the Session.Logon-function says:

For an anonymous profile, the format is
<server distinguished name> & vbLf & vbLf & "anon"
where the distinguished name of the server takes the form
/o=<enterprise>/ou=<site>/cn=Configuration/cn=Servers/cn=<s
erver>

but I am not sure I understand this explanation.

the server and the
 
 
 

Sending a mail from IIS 5.1 on XP Pro

Post by Dmitry Str » Thu, 11 Dec 2003 06:48:23

The server name is the name of the computer where the Exchange server is
running (MAIL in my case). Mailbox name can be anything that can be used to
unambiguously resolve a mailbox name (e.g. " XXXX@XXXXX.COM ", "Peder K.
Jensen", etc). Be careful of the permissions - the user account that your
ASP page is using must have access to that mailbox.

Dmitry Streblechenko (MVP)
http://www.yqcomputer.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool