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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET and Outlook

Status
Not open for further replies.

marcusw

Programmer
Jan 18, 2001
35
GB
I have a very simple bit of code that puts a message intot the Outbox of Outlook 2000. It uses the Outlook 10 Object Library and works perfectly within VB.NET. However, when I put exactly the same piece of code into an ASP.NET page (using excatly the same reference) it simply hangs when I try to add the email recipients.

I've been looking at this problem for a couple of days now and feel sure that the problem lies within the aspnet user permissions.

Here's the code.... As you can see it's pretty simple...

'On Error Resume Next
Dim oNewMail As Outlook.MailItem
Dim objOLApp As Outlook.Application
Dim x As Short
objOLApp = New Outlook.Application()
oNewMail = objOLApp.CreateIte(Outlook.OlItemType.olMailItem)
With oNewMail
.Subject = "Test Subject"
.Body = "Test Body"
.Recipients.Add("zc46@dial.pipx.com") - 'Hangs here....!
CType(oNewMail, Outlook._MailItem).Send()
End With
oNewMail = Nothing
objOLApp = Nothing

Any ideas?? It's driving me mad...!

Thanks,


Marcus.
 
Shot in the dark: ASP.NET runs under who's security profile? I ask this because the profile needs permission to post to the Outlook mail item. Check your server logs too for a clue.

I hope I helped. :)
 
Thanks,

I'm logged on as Administrator but I believe ASP.NET runs as a user called "aspnet". I understand your point about this user needing permission to Outlook but where would I set that.

Also, what logs would I need to look in? I'm using W2K Professional and nothing gets written to the event logs or IIS logs when I run this. Should I be looking at other logs?

Regards,

Marcus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top