|
-
Jun 19th, 2000, 04:18 AM
#1
Thread Starter
Member
I'm using MAPI to send mail via MS Exchange Server. I've setup a Mail profile in Control Panel, and when I send mail from Outlook Express, everything works fine.
However, when I try to use send mail from my VB app, I get the error message "Login Failed", even though my MAPISession has been started with no error and its SessionID property has been assigned to the equivalent property of my MAPIMessages control.
Any ideas?
Nahid Harjee
-
Jun 19th, 2000, 05:23 AM
#2
Thread Starter
Member
Hello?
-
Jun 19th, 2000, 11:07 PM
#3
Can you post your source code?
-
Jun 27th, 2000, 12:29 AM
#4
Thread Starter
Member
Here's my code (it's part of one of my classes):
Private Const LDT_profile = "LDT"
Private Sub Class_Initialize()
With frmContainer.MAPISess
.DownLoadMail = False
.LogonUI = False
.NewSession = True
.UserName = LDT_profile
.SignOn
frmContainer.MAPIMess.SessionID = .SessionID
End With
End Sub
Private Sub Class_Terminate()
frmContainer.MAPISess.SignOff
End Sub
Public Sub sendMail()
With frmContainer.MAPIMess
.Compose
.RecipAddress = "[email protected]"
.MsgSubject = "Test"
.MsgNoteText = "Test"
.Send
End With
End Sub
The sendMail method fails on the frmContainer.MAPIMess.Send method with either the error: Login has failed or Unspecified Error.
Any help would be greatly appreciated.
Nahid Harjee
-
Jun 27th, 2000, 01:37 AM
#5
Thread Starter
Member
PROBLEM SOLVED!
Don't worry about it, I've figured out the problem.
For some reason, with one-off messaging (ie. sending messages to users not in an address book), you must specify the e-mail address of the recipient in the RecipDisplayName property and not in the RecipAddress property.
So, it should be:
.RecipDisplayName = "[email protected]"
Don't ask me why, it's completely counter-intuitive. Ask M$.
Nahid Harjee
-
Jun 28th, 2000, 03:30 AM
#6
Yes, I had this problem before too.
Another solution to it is to load Outlook Address book.
Here is the code:
.MsgIndex = -1
.AddressEditFieldCount = 2
.Compose
.Show False
.ResolveName
.AddressResolveUI = True
Anna Carlen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|