Solved

ASP And MapiSession. Send Exchange email

Posted on 1999-01-10
3
215 Views
Last Modified: 2011-10-03
When using MapiSession.Logon the browser ask me for user login and password for Exchange Administrator to send email. How can I submit user login and password without that message box?

I use Nt 4.0, Exchange 5.5 and VBscript (ASP code). I only need to send an email to an exchange user!!

Can anyone help me?
0
Comment
Question by:javi2
3 Comments
 

Expert Comment

by:Ajoy
ID: 1455244
The answer to ur problem is the

LogonUI Property

Specifies whether or not a dialog box is provided for sign-on.

Syntax

object.LogonUI [ = value ]

The LogonUI property syntax has these parts:

object : Anobject expression that evaluates to an object in the Applies To list.
value : Aboolean expression specifying whether a logon dialog box is displayed, as described in Settings.

The settings for value are:

True (Default) :A dialog box prompts new users for their user name and password (unless a valid messaging session already exists. See the NewSession property for more information).
False  : No dialog box is displayed.
========

The False setting is useful when you want to begin a mail session without user intervention, and you already have the account name and password for the user. If insufficient or incorrect values are provided, however, an error is generate

0
 

Author Comment

by:javi2
ID: 1455245
I can't use LogonUI to pass login and password to Exchange Server 5.5, I find command to use in microsoft web.

Regards
0
 
LVL 6

Accepted Solution

by:
reddarin earned 100 total points
ID: 1455246
The answer is to drop the MAPI call and use the CDO interface. I wrote the sub below in VB but you could adapt it to use with VBscript by creating the object and assigning the properties. When you logon you supply a valid mapi profile and it works every time. In fact, I created an email based pager program that uses CDO to send the message out without prompting the user for a profile:
Public IMail As MAPI.Session
Public IMsg As Message      
Public IRec As Recipient

Set IMail = CreateObject("MAPI.Session")
IMail.Logon 'you can specify profile name and other parameters. It works everytime and you can prevent the dialog box from showing asking the user to choose a profile.

Set IMsg = IMail.Outbox.Messages.Add
Set IRec = IMsg.Recipients.Add

IMsg.Text = "Send immediately"
IRec.Name = "Darin@darin.com"
IRec.Type = CdoTo
IMsg.Send
IMail.DeliverNow

Set IMsg = Nothing
Set IRec = Nothing
Set IMail = Nothing

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now