Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2006, 04:27 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default send email through exchange server

Code:
Const cStrServer  = "Xchange"
Const cStrMailbox = "Admin"
bstrProfileInfo = cStrServer & vbLf & cStrMailbox 

Set objSess = Server.CreateObject("MAPI.Session") 
objSess.Logon "Admin","password",False,True, 0, True, bstrProfileInfo

   Set objFBMess = objSess.Outbox.Messages.Add
   objFBMess.Subject = "Test Exchange Mail"'Subject
   objFBMess.Text = "Content of the mail"


  Set objRecips = objFBMess.Recipients    objRecips.AddMultiple "Admin;test44654@hotmail.com"
  objRecips.Resolve

   objFBMess.Send

   objSess.Logoff
   Set objFBMess = nothing
   Set objRecip = nothing
   Set objSess = nothing

the above code work if i logon to the IIS server computer with "Admin" and run the asp page
but if i call that asp page from other computer(even with "Admin" account)it will show
Code:
Error Type:
Collaboration Data Objects (0x4F9)
The information store could not be opened. [MAPI 1.0 - [MAPI_E_LOGON_FAILED(80040111)]]
i think because when i call that asp, it run as IUSR_MyServer so it doesn't have permission to access the mailbox of "Admin"
but i thought that if i provide the Logon information
Code:
objSess.Logon "Admin","password",False,True, 0, True, bstrProfileInfo
it would be ok, i don't want to set up IUSR_Server account on exchange and use its mailbox, i need to use the user mailbox to send email.

Any help would be great
Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling a Users Email from AD or Exchange Zeus_Man General .NET 0 September 14th, 2006 09:33 AM
How to send email through exchange from ASP + C# sdh C# 0 October 22nd, 2005 01:33 PM
send & recive mails from exchange & lotus sever zaheersharief Pro VB 6 1 May 16th, 2005 06:55 AM
SQL and Exchange server c_bananas SQL Server 2000 0 October 10th, 2003 05:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.