Hi,
I have a web page that will send emails to various addresses, I've tried
using the SmtpMail class but no matter what I try it will not work.
I have an asp page that does actually work using mapi.session...
<%
Const cStrServer = "sciehex01"
Const cStrMailbox = "weeklyreportuser"
'insert a line feed
bstrProfileInfo = cStrServer & vbLf & cStrMailbox
'create session
Set objSess = Server.CreateObject("mapi.session")
objSess.Logon "","", False, True, 0, True, bstrProfileInfo
Set objFBMess = objSess.Outbox.Messages.Add
objFBMess.Subject = "Test Active Messaging"
objFBMess.Text = "Greetings from Active Messaging in ASP"
Set objRecips = objFBMess.Recipients
' e-mail name to send
objRecips.Add ("ke***********@scieh.csa.scot.nhs.uk")
'message to
objRecips.Resolve
objFBMess.Send
objSess.Logoff
%>
I am now trying to do the same in an ASP.net page by referencing the
Microsoft 1.21 CDO library.
In my page an error occurs when I try and call the logon method of the
logon method of the mapi.session object using the same variables ....
Object vEmpty = Missing.Value;
Object oResult;
Object [] argsLogon = new Object[7];
MAPI.Session oSession = new MAPI.Session();
bool a = false;
bool b = true;
int c = 0;
bool d = true;
string name = "";
string password = "";
argsLogon[0] = name; // ProfileName
argsLogon[1] = password; // ProfilePassword
argsLogon[2] = a; // ShowDialog
argsLogon[3] = b; // NewSession
argsLogon[4] = c; // ParentWindow
argsLogon[5] = d; // NoMail
argsLogon[6] = "sciehex01" + System.Environment.NewLine +
"WeeklyReportUser" ; // ProfileInfo
oSession.Logon(argsLogon[0],argsLogon[1],argsLogon[2],argsLogon[3],a
rgsLogon[4],argsLogon[5],argsLogon[6]);
but I get the following error ..
[Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]]
Any help would be gratefully appreciated.
Thanks,
Kevin.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!