Solved

ASP And MapiSession. Send Exchange email

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paint/Redraw window while dragging 16 86
Exit a vb6 apps when a calling it apps closes 15 57
MsgBox 4 71
backup program with robocopy 6 69
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

685 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