Solved

ASP And MapiSession. Send Exchange email

Posted on 1999-01-10
3
217 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 90
Protecting vb6 & .Net code Obfuscation 18 97
Passing a Text Box name to a Sub 6 79
fso.FolderExists("\\server\HiddenFolder$") 4 52
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

861 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

25 Experts available now in Live!

Get 1:1 Help Now