Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mapi session id

Status
Not open for further replies.

rozzay

Programmer
Jan 3, 2002
142
US
Hi I am trying to use mapi for email but I am very new at it..currently i am receiving a error message saying:
MAPI FAILURE: VALID SESSION ID DOES NOT EXIST.

below are my codes so far if this might help any..

Private Sub Form_Load()
MAPISession1.SessionID = MAPISession1.SessionID
MAPIMessages1.Fetch
If MAPIMessages1.MsgCount > 0 Then
txtTo.Text = MAPIMessages1.RecipDisplayName
txtSubject = MAPIMessages1.MsgSubject
Else
MsgBox "Error"
MAPISession1.SignOff
End If
txtTo.Text = "rosyoshit@yahoo.com"
If bView = True Then
ViewData
End If
end sub

Private Sub EmailData()
txtSubject.Text = "EDI PROD PO Log/WEBEDI" & " " & Now
MAPIMessages1.Compose
MAPIMessages1.RecipAddress = txtTo.Text
MAPIMessages1.MsgSubject = txtSubject.Text
MAPIMessages1.Send
end sub
 
The following line is a self-assignment

MAPISession1.SessionID = MAPISession1.SessionID

You might try something like the following

With MAPISession
.NewSession = True
.LogonUI = True
.UserName = <your profile name here>
.SignOn
End With
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
thanks, another question. On my profile name I tried use my Lan ID but it says invalid profile name so Choose Profile form box comes up and gives me the option to create a new profile. How would I find out what my correct profile name?? and if i did not have one how do I create a profile name???
 
If I remember correctly, that dialog box contains a combo box which contains a list of the already established profiles. If none exist, or there is not one that you can use, then I would proceed through the add function.
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
ALRIGHTY I WENT THRU AND ADD MYSELF TO THE PROFILE AND IT LOOKS LIKE I WAS ABLE TO SIGN ON, BUT I RECEIVED AN ERROR SAYING: VALID SESSION ID DOES NOT EXIST.
AM I BACK WHERE I STARTED??


Private Sub Form_Load()
With MAPISession1
.NewSession = True
.DownLoadMail = True
.LogonUI = True
.UserName = &quot;ROZZAY&quot;
.SignOn
MsgBox &quot;SIGN ON&quot;
End With

MAPIMessages1.Fetch
If MAPIMessages1.MsgCount > 0 Then
txtTo.Text = MAPIMessages1.RecipDisplayName
txtSubject = MAPIMessages1.MsgSubject
Else
MsgBox &quot;Error&quot;
MAPISession1.SignOff
End If
txtTo.Text = &quot;Luong@aafes.com&quot;
txtCC.Text = &quot;sommerrw@aafes.com&quot;
If bView = True Then
ViewData
End If

End Sub
 
After the signon - connect the MAPI SessionID from the Session object to the MAPI Message Object

MAPIMessages1.SessionID = MAPISession1.SessionID


Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top